MXF XAVC UHD video stream modified while using the -copy option
Hello, I'm trying to remux a MXF XAVC file with the exact same video but only 2 out of the 4 audio tracks. For that I use this command: ffmpeg -i INPUT_FILE -c copy -map 0:v -map 0:a:0 -map 0:a:1 OUTPUT_FILE The thing is, some video data are lost during the remux as my file is smaller than it should be. If I check with MediaInfo, the video stream bit rate, bits/(pixel*frame) value and stream size are smaller. Here is the output of the original file: Video ID : 2 Format : AVC Format/Info : Advanced Video Codec Format profile : High 4:2:2 Intra@L5.1<mailto:Intra@L5.1> Format settings, CABAC : No Format settings, GOP : N=1 Format settings, wrapping mode : Frame Codec ID : 0D01030102106001-0401020201323001 Duration : 4 min 30 s Bit rate : 506 Mb/s Width : 3 840 pixels Height : 2 160 pixels Display aspect ratio : 16:9 Frame rate : 50.000 FPS Standard : Component Color space : YUV Chroma subsampling : 4:2:2 Bit depth : 10 bits Scan type : Progressive Bits/(Pixel*Frame) : 1.219 Stream size : 15.9 GiB (99%) Color range : Limited Color primaries : BT.2020 Transfer characteristics : HLG Matrix coefficients : BT.2020 non-constant And of the remuxed file: Video ID : 2 Format : AVC Format/Info : Advanced Video Codec Format profile : High 4:2:2 Intra@L5.1<mailto:Intra@L5.1> Format settings, CABAC : No Format settings, GOP : N=1 Format settings, wrapping mode : Frame Codec ID : 0D01030102106001-0401020201323001 Duration : 4 min 30 s Bit rate : 500 Mb/s Width : 3 840 pixels Height : 2 160 pixels Display aspect ratio : 16:9 Frame rate : 50.000 FPS Standard : Component Color space : YUV Chroma subsampling : 4:2:2 Bit depth : 10 bits Scan type : Progressive Bits/(Pixel*Frame) : 1.207 Stream size : 15.7 GiB (100%) Color range : Limited Color primaries : BT.2020 Transfer characteristics : HLG Matrix coefficients : BT.2020 non-constant Using current release 3.4.1 and latest nightly (N-89956-gcaa4bd7a9f) does the exact same thing. Any idea what's happening and how I can prevent this loss? Many thanks in advance for your help, Ronan
2018-02-06 18:09 GMT+01:00 Ronan Ricou <r.ricou@b-architech.com>:
I'm trying to remux a MXF XAVC file with the exact same video but only 2 out of the 4 audio tracks. For that I use this command: ffmpeg -i INPUT_FILE -c copy -map 0:v -map 0:a:0 -map 0:a:1 OUTPUT_FILE
The thing is, some video data are lost during the remux as my file is smaller than it should be.
How do you know this? Please test current FFmpeg git head and provide the command line you tested together with the complete, uncut console output. Carl Eugen
Hi, I know this because the size of the video stream isn't the same on the remuxed file. As its duration is the same as I can play it without any problem, I think some metadata were stripped off, but I don't know which and why. You can also see this in the MediaInfo report I included in my original message. I even tried to do a full remux, with the command ffmpeg -i INPUT_FILE -c copy -map 0 OUTPUT_FILE, and the files size aren't the same at all, there is a 165MB difference on the 16GB file I used (duration: 4m30s). The source one is 17 245 128 240 Byte and the remuxed on is 17 072 370 871 Byte Here is a pastebin to the full ffmpeg report of the remux process output: https://pastebin.com/1g7wy59u Full report of the input file: https://pastebin.com/jF1VKWgM Full report of the output file: https://pastebin.com/hn17PHKC Note: for the report I used the -probesize 100M option as otherwise I didn't get all the file information because after some time I get the following error message " Probe buffer size limit of 5000000 bytes reached". Best Regards, Ronan -----Message d'origine----- De : ffmpeg-user [mailto:ffmpeg-user-bounces@ffmpeg.org] De la part de Carl Eugen Hoyos Envoyé : mercredi 7 février 2018 00:36 À : FFmpeg user questions <ffmpeg-user@ffmpeg.org> Objet : Re: [FFmpeg-user] MXF XAVC UHD video stream modified while using the -copy option 2018-02-06 18:09 GMT+01:00 Ronan Ricou <r.ricou@b-architech.com>:
I'm trying to remux a MXF XAVC file with the exact same video but only 2 out of the 4 audio tracks. For that I use this command: ffmpeg -i INPUT_FILE -c copy -map 0:v -map 0:a:0 -map 0:a:1 OUTPUT_FILE
The thing is, some video data are lost during the remux as my file is smaller than it should be.
How do you know this? Please test current FFmpeg git head and provide the command line you tested together with the complete, uncut console output. Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
2018-02-07 9:30 GMT+01:00 Ronan Ricou <r.ricou@b-architech.com>:
I know this because the size of the video stream isn't the same on the remuxed file.
How did you check this? Please do not top-post here, Carl Eugen (And please do not use external resources for the console output, they can disappear.)
Media info output, as I included in my initial question. Stream size in original file is 15.9GiB and 15.8GiB on ffmpeg remuxed one. Stream size for all audio element is the exact same on both files. In addition, if you look at the report I linked, you will also see that the overall bitrate reported by ffmpeg isn't the same : 510Mb/s for the original file and 505Mb/s for the ffmpeg one, using the command: ffmpeg -probesize 100M -i D:\test_uhd_ba1.mxf -c copy -map 0 D:\remux_uhd_2a.mxf You will see that the audio bitrate per channel is the exact same, so only the video has changed somehow. Best Regards, Ronan -----Message d'origine----- De : ffmpeg-user [mailto:ffmpeg-user-bounces@ffmpeg.org] De la part de Carl Eugen Hoyos Envoyé : mercredi 7 février 2018 11:45 À : FFmpeg user questions <ffmpeg-user@ffmpeg.org> Objet : Re: [FFmpeg-user] MXF XAVC UHD video stream modified while using the -copy option 2018-02-07 9:30 GMT+01:00 Ronan Ricou <r.ricou@b-architech.com>:
I know this because the size of the video stream isn't the same on the remuxed file.
How did you check this? Please do not top-post here, Carl Eugen (And please do not use external resources for the console output, they can disappear.) _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
2018-02-07 12:21 GMT+01:00 Ronan Ricou <r.ricou@b-architech.com>:
Media info output, as I included in my initial question.
I don't think FFmpeg drops video data for your command line and I don't think MediaInfo would be able to show you such a drop. Feel free to use third-party tools to extract the video streams and compare them, for example by counting frames. Carl Eugen
The video itself seems fine (same duration, frame accurate), it's just that I don't know where the size difference come from and what information are lost. I tried to open the file created by FFMPEG to BlackMagic Design Resolve software, and it won't. As I don't have any problem with the original file, maybe something is missing in the MXF metadata. I'm still searching what's wrong. Best Regards, Ronan -----Message d'origine----- De : ffmpeg-user [mailto:ffmpeg-user-bounces@ffmpeg.org] De la part de Carl Eugen Hoyos Envoyé : mercredi 7 février 2018 13:04 À : FFmpeg user questions <ffmpeg-user@ffmpeg.org> Objet : Re: [FFmpeg-user] MXF XAVC UHD video stream modified while using the -copy option 2018-02-07 12:21 GMT+01:00 Ronan Ricou <r.ricou@b-architech.com>:
Media info output, as I included in my initial question.
I don't think FFmpeg drops video data for your command line and I don't think MediaInfo would be able to show you such a drop. Feel free to use third-party tools to extract the video streams and compare them, for example by counting frames. Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
2018-02-07 14:06 GMT+01:00 Ronan Ricou <r.ricou@b-architech.com>:
The video itself seems fine (same duration, frame accurate), it's just that I don't know where the size difference come from and what information are lost.
Which size difference?
I tried to open the file created by FFMPEG to BlackMagic Design Resolve software, and it won't.
(LOL!) Feel free to do the same test as in the other current mxf thread. Carl Eugen
Hi, Regarding the size difference, I already detailed it on my previous message: "I even tried to do a full remux, with the command ffmpeg -i INPUT_FILE -c copy -map 0 OUTPUT_FILE, and the files size aren't the same at all, there is a 165MB difference on the 16GB file I used (duration: 4m30s). The source one is 17 245 128 240 Byte and the remuxed on is 17 072 370 871 Byte" Anyway, on the two MXF analyzer tools I used, IRT MXF Analyzer and Metaglue MXFixer, the MXF created by FFMpeg contains many warnings and a critical error: ERROR : Partition ClosedCompleteHeader at 0x00000000 is a flagged as "complete" however MPEG2VideoDescriptor/VideoLineMap at 000015d4 is set to its distinguished value. As it was getting nowhere, I decided to use bmx MXF tools instead, and demuxed then rewrap the mxf file with mxf2rax and raw2bmx, and my MXF file doesn't have any error anymore. On the top of that, it can be opened in all NLE I tested, including BMD Resolve. There is still a size difference between the original file and the remuxed one, but everything seems in place. If I ever find out where this size difference comes from and why, I will let you know. Best Regards, Ronan -----Message d'origine----- De : ffmpeg-user [mailto:ffmpeg-user-bounces@ffmpeg.org] De la part de Carl Eugen Hoyos Envoyé : mercredi 7 février 2018 19:13 À : FFmpeg user questions <ffmpeg-user@ffmpeg.org> Objet : Re: [FFmpeg-user] MXF XAVC UHD video stream modified while using the -copy option 2018-02-07 14:06 GMT+01:00 Ronan Ricou <mailto:r.ricou@b-architech.com>:
The video itself seems fine (same duration, frame accurate), it's just that I don't know where the size difference come from and what information are lost.
Which size difference?
I tried to open the file created by FFMPEG to BlackMagic Design Resolve software, and it won't.
(LOL!) Feel free to do the same test as in the other current mxf thread. Carl Eugen _______________________________________________ ffmpeg-user mailing list mailto:ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email mailto:ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
2018-02-08 9:15 GMT+01:00 Ronan Ricou <r.ricou@b-architech.com>:
Regarding the size difference, I already detailed it on my previous message: "I even tried to do a full remux, with the command ffmpeg -i INPUT_FILE -c copy -map 0 OUTPUT_FILE, and the files size aren't the same at all, there is a 165MB difference on the 16GB file I used (duration: 4m30s). The source one is 17 245 128 240 Byte and the remuxed on is 17 072 370 871 Byte"
Sorry if this wasn't completely obvious: It is expected that output files do not have to same size as input files after remuxing (for non-raw containers). Stream sizes are of course identical but you didn't test them afaict.
Anyway, on the two MXF analyzer tools I used, IRT MXF Analyzer and Metaglue MXFixer, the MXF created by FFMpeg contains many warnings and a critical error: ERROR : Partition ClosedCompleteHeader at 0x00000000 is a flagged as "complete" however MPEG2VideoDescriptor/VideoLineMap at 000015d4 is set to its distinguished value.
Yes, this sounds like the other mxf issue reported: As said there, please test if setting a value for video line map is all that's missing. And please stop top-posting Carl Eugen
On 06/02/2018 18:09, Ronan Ricou wrote:
The thing is, some video data are lost during the remux as my file is smaller than it should be. If I check with MediaInfo, the video stream bit rate, bits/(pixel*frame) value and stream size are smaller.
(disclaimer: I am the main MediaInfo developer) In your case I think the video bit rate is estimated by MediaInfo from container size minus audio size minus estimated container overhead, and the difference may be due to some padding bytes in the MXF stream not copied by FFmpeg (for good reasons) and not the video stream size itself. MediaInfo is not intended to be used for such small difference check, at least by default (i.e. without scanning the whole file). An additional information about if the indicated size is computed for sure or estimated is on our ToDo-list without ETA.
participants (3)
-
Carl Eugen Hoyos -
Jerome Martinez -
Ronan Ricou