Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video Support in V1.0: part 1/3 : support matroskavideo #2370

Closed
wants to merge 23 commits into from
Closed

Video Support in V1.0: part 1/3 : support matroskavideo #2370

wants to merge 23 commits into from

Conversation

mohamedchebbii
Copy link
Contributor

Hello,
I want to retsore the support of video files, I begin with matroskavideo and I will add tiff and asf format during next days.
Here a sample test results:

./bin/exiv2 -p x  ~/Downloads/sample_960x400_ocean_with_audio.mkv
Xmp.video.FileName                           XmpText    85  /home/mohamed.chebbi/Downloads/sample_960x400_ocean_with_audio.mkv
Xmp.video.FileSize                           XmpText     7  16.5413
Xmp.video.MimeType                           XmpText    14  video/matroska
Xmp.video.EBMLVersion                        XmpText     1  1
Xmp.video.EBMLReadVersion                    XmpText     1  1
Xmp.video.DocType                            XmpText     8  matroska
Xmp.video.DocTypeVersion                     XmpText     1  4
Xmp.video.DocTypeReadVersion                 XmpText     1  2
Xmp.video.TimecodeScale                      XmpText     5  0.001
Xmp.video.MuxingApp                          XmpText    13  Lavf58.45.100
Xmp.video.WritingApp                         XmpText    13  Lavf58.45.100
Xmp.video.Duration                           XmpText     5  46616
Xmp.video.TotalStream                        XmpText     1  1
Xmp.video.FrameRate                          XmpText     6  23.976
Xmp.video.Width                              XmpText     3  960
Xmp.video.Height                             XmpText     3  400
Xmp.video.AspectRatio                        XmpText     3  2.4

Please let me know If I miss anything, I will be happy to add It.
Best Regards,

@postscript-dev
Copy link
Collaborator

@mohamedchebbii

Please let me know If I miss anything, I will be happy to add It.

Since the video support was removed, @neheb has continued using clang-tidy to modernize the code to be compatible with C++17. I don't know which C++ version the video code currently supports but some small changes may be needed to comply. @neheb, do you have any thoughts on this?

@mohamedchebbii, please can you add at least one (small) test file to demonstrate that the code in your PR works. I don't know if we have a valid file in the 0.27-maintenance branch, perhaps the code was untested by the CI? Also, I remember that Exiv2 discussed storing larger files outside of the Exiv2 repository (e.g., #896) and downloading them as needed, but I'm not sure what we decided.

@neheb
Copy link
Collaborator

neheb commented Sep 28, 2022

I'd run through clang-tidy, yes. On a quick glance, I see constructors not marked as delete and not marked public. I'm guessing this is copy/paste from somewhere.

/*!
@brief Helper structure for the Matroska tags lookup table.
*/
struct MatroskaTags {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A simple std::pair is good enough I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 65a01dc

void aspectRatio();

private:
//! @name NOT Implemented
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not implemented functions should be public and marked = delete;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done here 65a01dc

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm? I don't see = delete;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad, It's here : 49f6acd

src/matroskavideo.cpp Outdated Show resolved Hide resolved
src/matroskavideo.cpp Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 28, 2022

Codecov Report

Merging #2370 (f14bf95) into main (597e372) will decrease coverage by 0.76%.
The diff coverage is 11.55%.

@@            Coverage Diff             @@
##             main    #2370      +/-   ##
==========================================
- Coverage   64.20%   63.43%   -0.77%     
==========================================
  Files         119      121       +2     
  Lines       21082    21361     +279     
  Branches    10393    10513     +120     
==========================================
+ Hits        13535    13550      +15     
- Misses       5393     5651     +258     
- Partials     2154     2160       +6     
Impacted Files Coverage Δ
include/exiv2/matroskavideo.hpp 0.00% <0.00%> (ø)
include/exiv2/types.hpp 81.81% <ø> (ø)
src/matroskavideo.cpp 4.71% <4.71%> (ø)
src/image.cpp 70.84% <91.66%> (+0.39%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mohamedchebbii mohamedchebbii marked this pull request as draft September 30, 2022 10:55
@mohamedchebbii mohamedchebbii marked this pull request as ready for review October 2, 2022 20:13
include/exiv2/types.hpp Outdated Show resolved Hide resolved
src/image.cpp Outdated Show resolved Hide resolved
…windows compilation issue and some format issues
@kevinbackhouse kevinbackhouse self-requested a review October 4, 2022 09:03
@kevinbackhouse
Copy link
Collaborator

Before this gets merged, I'd like to run the fuzzer on it for a few days. I'll wait until the rest of the code review is done, so please ping me when you think it's ready to merge.

@mergify
Copy link
Contributor

mergify bot commented Oct 4, 2022

⚠️ The sha of the head commit of this PR conflicts with #2373. Mergify cannot evaluate rules on this PR. ⚠️

@mohamedchebbii mohamedchebbii restored the 1748 branch October 4, 2022 22:02
@mohamedchebbii mohamedchebbii reopened this Oct 4, 2022
@neheb
Copy link
Collaborator

neheb commented Oct 8, 2022

Needs rebasing.

@kevinbackhouse
Copy link
Collaborator

I started the fuzzer and it found a couple of crashes within a few minutes. The crash files are here: crash.tar.gz

Please could you read the README in the fuzz sub-directory and run the fuzzer yourself to check for other bugs?

@kevinbackhouse
Copy link
Collaborator

I notice that the only test in this PR is a very basic unit test. For a new source file like this, we need some proper test files in test/data with associated test scripts in tests/.

@param buf Pointer to the memory area with the tag information.
@param size Size of \em buf.
*/
void contentManagement(const MatroskaTags* mt, const byte* buf, long size);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use the long type. We're trying to eliminate it from the codebase. We usually use size_t for sizes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understood, thank you very much @kevinbackhouse for your time.
I will analyse the crash report and run locally the fuzz test to fix them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replacing long by size_t done here f14bf95

kevinbackhouse and others added 14 commits October 20, 2022 23:02
* Fix BmffImage::writeMetadata() error id/message

* Add exceptions setting Exif/IPTC/XMP in BMFF

* Add missing header for new functions
Easier to read with lambdas.

Signed-off-by: Rosen Penev <[email protected]>
Video Support in V1.0: part 1/4 : support matroskavideo

 Video Support in V1.0: part 1/3 : support matroskavideo : upgrade code and clean up

 Video Support in V1.0: part 1/3 : support matroskavideo : clang-format

Video Support in V1.0: part 1/3 : support matroskavideo : Add unit tests and some minor fix

Video Support in V1.0: part 1/3 : support matroskavideo : try to fix windows compilation issue and some format issues

Video Support in V1.0: part 1/3 : support matroskavideo : Fix windows compilation issue and some format issues

Video Support in V1.0: part 1/3 : support matroskavideo : Format with clang-format-12

Video Support in V1.0: part 1/3 : support matroskavideo : Format with clang-format-12 patch 2
@mohamedchebbii
Copy link
Contributor Author

Needs rebasing.

done here f14bf95

@mohamedchebbii mohamedchebbii closed this by deleting the head repository Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants