MXF container tags modified when replacing audio
Hi, I use ffmpeg to replace audio streams in MXF containers, with -c:v option to leave video stream unchanged. I thought that all MXF metadata and tags would be unchanged, but that's not the case and everything's is changed in the header. Most of time it's not an issue, but in a particular case, the player can't read properly the file as the "Video Line Map" tag value is not what expected. Is there a way to keep all MXF's header value unchanged ? Best, Fred
2018-01-22 17:07 GMT+01:00 Frédéric Busnel-Joncour <fred.bj@free.fr>:
I use ffmpeg to replace audio streams in MXF containers
The tool ffmpeg does not support "replacing" streams in containers. If you provide the command line you tested and the complete, uncut console output, we may be able to understand what missing feature in the mxf (de-)muxer you need. Carl Eugen
I use ffmpeg to replace audio streams in MXF containers
The tool ffmpeg does not support "replacing" streams in containers.
If you provide the command line you tested and the complete, uncut console output, we may be able to understand what missing feature in the mxf (de-)muxer you need.
Hi Carl Eugen, Thanks for support. Just to be clear, I inspect the MXF files (before/after audio replacement) in a dedicated MXF software as ffprobe/ffmpeg doesn't give any clue about these MXF header metadata in the console. Here is my console out : ffmpeg -i TEST_UHD_before.mxf -i TEST_UHD_audio.wav -map 0:v -map 1:a -map 1:a -map 1:a -map 1:a -codec copy TEST_UHD_after.mxf ffmpeg version N-88116-gacf70639fb-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers built with gcc 6.4.0 (Debian 6.4.0-8) 20171010 configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg libavutil 56. 0.100 / 56. 0.100 libavcodec 58. 0.100 / 58. 0.100 libavformat 58. 0.100 / 58. 0.100 libavdevice 58. 0.100 / 58. 0.100 libavfilter 7. 0.100 / 7. 0.100 libswscale 5. 0.100 / 5. 0.100 libswresample 3. 0.100 / 3. 0.100 libpostproc 55. 0.100 / 55. 0.100 [h264 @ 0x4fdf3c0] Truncating likely oversized PPS (9469 > 4096) Last message repeated 3 times [mxf @ 0x4fd6ee0] Stream #0: not enough frames to estimate rate; consider increasing probesize [mxf @ 0x4fd6ee0] decoding for stream 0 failed Guessed Channel Layout for Input Stream #0.1 : mono Guessed Channel Layout for Input Stream #0.2 : mono Guessed Channel Layout for Input Stream #0.3 : mono Guessed Channel Layout for Input Stream #0.4 : mono Input #0, mxf, from 'TEST_UHD_before.mxf': Metadata: product_uid : 0c3919fe-46e8-11e5-a151-feff819cdc9f uid : 1d941001-ff87-11e7-b8b9-00254b97cf9b generation_uid : 1d941002-ff87-11e7-a59e-00254b97cf9b company_name : Adobe Systems Incorporated product_name : Adobe Media Encoder product_version : 10.4.0 application_platform: Mac OS X modification_date: 2018-01-22T15:15:44.000000Z material_package_umid: 0x060A2B340101010501010D121300000000614603408105A557BB00254B97CF9B timecode : 10:00:00:00 Duration: 00:00:30.00, start: 0.000000, bitrate: 257184 kb/s Stream #0:0: Video: h264 (High 4:2:2 Intra), yuv422p10le(tv, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 50 tbc Metadata: file_package_umid: 0x060A2B340101010501010D121366212500614603408105A5C01700254B97CF9B file_package_name: Source Package track_name : Track 2 Stream #0:1: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s Metadata: file_package_umid: 0x060A2B340101010501010D121366212500614603408105A5C01700254B97CF9B file_package_name: Source Package track_name : Track 3 Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s Metadata: file_package_umid: 0x060A2B340101010501010D121366212500614603408105A5C01700254B97CF9B file_package_name: Source Package track_name : Track 4 Stream #0:3: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s Metadata: file_package_umid: 0x060A2B340101010501010D121366212500614603408105A5C01700254B97CF9B file_package_name: Source Package track_name : Track 5 Stream #0:4: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s Metadata: file_package_umid: 0x060A2B340101010501010D121366212500614603408105A5C01700254B97CF9B file_package_name: Source Package track_name : Track 6 Input #1, wav, from 'TEST_UHD_audio.wav': Metadata: encoder : Lavf58.0.100 timecode : 10:00:00:00 Duration: 00:00:30.00, bitrate: 1152 kb/s Stream #1:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32 (24 bit), 1152 kb/s Output #0, mxf, to 'TEST_UHD_after.mxf': Metadata: product_uid : 0c3919fe-46e8-11e5-a151-feff819cdc9f uid : 1d941001-ff87-11e7-b8b9-00254b97cf9b generation_uid : 1d941002-ff87-11e7-a59e-00254b97cf9b company_name : Adobe Systems Incorporated product_name : Adobe Media Encoder product_version : 10.4.0 application_platform: Mac OS X modification_date: 2018-01-22T15:15:44.000000Z material_package_umid: 0x060A2B340101010501010D121300000000614603408105A557BB00254B97CF9B timecode : 10:00:00:00 encoder : Lavf58.0.100 Stream #0:0: Video: h264 (High 4:2:2 Intra), yuv422p10le(tv, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 25 tbn, 25 tbc Metadata: file_package_umid: 0x060A2B340101010501010D121366212500614603408105A5C01700254B97CF9B file_package_name: Source Package track_name : Track 2 Stream #0:1: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32 (24 bit), 1152 kb/s Stream #0:2: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32 (24 bit), 1152 kb/s Stream #0:3: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32 (24 bit), 1152 kb/s Stream #0:4: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32 (24 bit), 1152 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #1:0 -> #0:1 (copy) Stream #1:0 -> #0:2 (copy) Stream #1:0 -> #0:3 (copy) Stream #1:0 -> #0:4 (copy) Press [q] to stop, [?] for help [NULL @ 0x4fdf3c0] Truncating likely oversized PPS (9469 > 4096) Last message repeated 338 times [NULL @ 0x4fdf3c0] Truncating likely oversized PPS (9469 > 4096)ate=256355.3kbits/s speed=26.7x Last message repeated 341 times [NULL @ 0x4fdf3c0] Truncating likely oversized PPS (9469 > 4096)ate=256746.2kbits/s speed= 27x Last message repeated 64 times frame= 750 fps=676 q=-1.0 Lsize= 941647kB time=00:00:30.00 bitrate=257132.3kbits/s speed= 27x video:922875kB audio:16875kB subtitle:0kB other streams:0kB global headers:9kB muxing overhead: 0.201817%
2018-01-22 17:07 GMT+01:00 Frédéric Busnel-Joncour <fred.bj@free.fr>:
Most of time it's not an issue, but in a particular case, the player can't read properly the file as the "Video Line Map" tag value is not what expected.
How do you know that this is the (one) value that stops your player from decoding FFmpeg's output file? What is the value that your input file shows (and the player expects) and what value is written by FFmpeg? (I can confirm that for 3840x2160 no useful value is written.) Carl Eugen
Most of time it's not an issue, but in a particular case, the player can't read properly the file as the "Video Line Map" tag value is not what expected.
How do you know that this is the (one) value that stops your player from decoding FFmpeg's output file? What is the value that your input file shows (and the player expects) and what value is written by FFmpeg?
(I can confirm that for 3840x2160 no useful value is written.)
Hi Carl Eugen, Thanks for support again ! As I'm not the end user, it's difficult to tell you exactly, but the problem occurs with Avid Media Composer. Video Line Map should be at 42, and it's at 0. Perhaps it's not technically possible, but an option like -keep_all_metadata would be very helpful in such case. Best regards, Fred
2018-02-05 18:07 GMT+01:00 Frédéric Busnel-Joncour <fred.bj@free.fr>:
Most of time it's not an issue, but in a particular case, the player can't read properly the file as the "Video Line Map" tag value is not what expected.
How do you know that this is the (one) value that stops your player from decoding FFmpeg's output file? What is the value that your input file shows (and the player expects) and what value is written by FFmpeg?
(I can confirm that for 3840x2160 no useful value is written.)
Thanks for support again ! As I'm not the end user, it's difficult to tell you exactly, but the problem occurs with Avid Media Composer. Video Line Map should be at 42, and it's at 0.
Sorry, I am not sure I understand correctly: If you change the value "0" for Video Line Map in a 3840x2160 file created with FFmpeg to "42", the file works with Avid Media Composer?
Perhaps it's not technically possible, but an option like -keep_all_metadata would be very helpful in such case.
Sorry if I was unclear in my first message in this thread: Just as FFmpeg is unable to "replace" streams, you cannot "keep" metadata. Carl Eugen
Thanks for support again ! As I'm not the end user, it's difficult to tell you exactly, but the problem occurs with Avid Media Composer. Video Line Map should be at 42, and it's at 0.
Sorry, I am not sure I understand correctly: If you change the value "0" for Video Line Map in a 3840x2160 file created with FFmpeg to "42", the file works with Avid Media Composer?
Hi Carl Eugen, As far as I know, yes. But I don't know how to change this value with ffmpeg or any other tool.
Perhaps it's not technically possible, but an option like -keep_all_metadata would be very helpful in such case.
Sorry if I was unclear in my first message in this thread: Just as FFmpeg is unable to "replace" streams, you cannot "keep" metadata.
Very clear, thanks. Best regards, Fred
2018-02-07 10:32 GMT+01:00 Frédéric Busnel-Joncour <fred.bj@free.fr>:
Thanks for support again ! As I'm not the end user, it's difficult to tell you exactly, but the problem occurs with Avid Media Composer. Video Line Map should be at 42, and it's at 0.
Sorry, I am not sure I understand correctly: If you change the value "0" for Video Line Map in a 3840x2160 file created with FFmpeg to "42", the file works with Avid Media Composer?
As far as I know, yes.
How do you know?
But I don't know how to change this value with ffmpeg or any other tool.
Either change the "default" video line map value in line 1166 of libavformat/mxfenc.c and recompile or use a "hex editor" on the output file. Carl Eugen
Sorry, I am not sure I understand correctly: If you change the value "0" for Video Line Map in a 3840x2160 file created with FFmpeg to "42", the file works with Avid Media Composer?
As far as I know, yes.
How do you know?
Technical advise of the TV Network that handled the files for editorial.
But I don't know how to change this value with ffmpeg or any other tool.
Either change the "default" video line map value in line 1166 of libavformat/mxfenc.c and recompile or use a "hex editor" on the output file.
Thanks. I'll try to recompile, even if it's always a hard way for me (never could do it with all the needed options). Regards, Fred
2018-02-07 12:47 GMT+01:00 Frédéric Busnel-Joncour <fred.bj@free.fr>:
Sorry, I am not sure I understand correctly: If you change the value "0" for Video Line Map in a 3840x2160 file created with FFmpeg to "42", the file works with Avid Media Composer?
As far as I know, yes.
How do you know?
Technical advise of the TV Network that handled the files for editorial.
But I don't know how to change this value with ffmpeg or any other tool.
Either change the "default" video line map value in line 1166 of libavformat/mxfenc.c and recompile or use a "hex editor" on the output file.
Thanks. I'll try to recompile, even if it's always a hard way for me
(never could do it with all the needed options).
The needed options for this test are: $ ./configure && make ffmpeg Carl Eugen
The needed options for this test are: $ ./configure && make ffmpeg
Yes, but I sometimes need some additional features and codecs. ;-) Best regards, Fred
The needed options for this test are: $ ./configure && make ffmpeg
Hi again, Just had a look at it, I think that I could as well add this line after line 1165 : case 2160: f1 = 42; f2 = 0; break; // progressive Right ? Fred
2018-02-07 17:18 GMT+01:00 Frédéric Busnel-Joncour <fred.bj@free.fr>:
The needed options for this test are: $ ./configure && make ffmpeg
Hi again,
Just had a look at it, I think that I could as well add this line after line 1165 :
case 2160: f1 = 42; f2 = 0; break; // progressive
Right ?
Only if it works. Carl Eugen
participants (2)
-
Carl Eugen Hoyos -
Frédéric Busnel-Joncour