Open FranceBB opened 2 years ago
@FranceBB Can you do a dump of the source MXF file at https://registry.smpte-ra.org/apps/regxmldump/view/published/
Done. Source MXF Dump.zip
It looks like FFmpeg does not support writing MCA sub-descriptors, which contain the language information:
Language seems to be working when converting to MP4: ffmpeg -i WAV_d01bc6be-ae2f-436b-9705-c402e1d92212.mxf out.mp4
The audio track in out.mp4 is labeled "English".
Gotcha, so it's not the IMF code but rather an FFMpeg mxf muxer limitation. I've created a ticket in the official bug tracker asking for the new feature. Let's see if someone is gonna pick it up or if it's gonna die out like other mxf related requests... :(
Actually, I'm going to re-open this, 'cause I made some new discoveries.
Decoding the mxf file directly does indeed make the info being displayed in FFMpeg (so I can remux into something else that isn't mxf and supports the language tagging), however such an info ain't displayed when the file is opened by the CPL IMF decoder, thus preventing me from using other containers like mkv etc.
By opening the mxf file directly:
H:\x262 Audio Hardsubber (x86) - Final>ffmpeg.exe -i "\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\hitch_sdr_sky_italy\IMF9668671_HITCH_2D_D_UHD_LB240_XVYCC_2398_TXT_ENG_00.mxf" -i "\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\hitch_sdr_sky_italy\IMF10544357_HITCH_2D_D_UHD_LB240_XVYCC_2398_TXT_ITA_ITA_DS.mxf" -map 0:0 -map 1:0 -vcodec copy -acodec copy -t 1 -f mxf -y "\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\trim.mxf"
ffmpeg version git-2022-01-28-f581139854-20220128 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (crosstool-NG 1.24.0.498_5075e1f)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220128
libavutil 57. 18.100 / 57. 18.100
libavcodec 59. 20.100 / 59. 20.100
libavformat 59. 17.101 / 59. 17.101
libavdevice 59. 5.100 / 59. 5.100
libavfilter 8. 25.100 / 8. 25.100
libswscale 6. 5.100 / 6. 5.100
libswresample 4. 4.100 / 4. 4.100
libpostproc 56. 4.100 / 56. 4.100
Input #0, mxf, from '\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\hitch_sdr_sky_italy\IMF9668671_HITCH_2D_D_UHD_LB240_XVYCC_2398_TXT_ENG_00.mxf':
Metadata:
operational_pattern_ul: 060e2b34.04010101.0d010201.01010100
uid : 1a566ace-8338-4b8f-a82e-441affdf6970
company_name : Rohde and Schwarz DVS GmbH
product_name : Clipster
product_version : 5.10.0.19
product_version_num: 5.10.0.19.1
toolkit_version_num: 1.2.0.19.4
application_platform: Windows Server 2008 R2 (64-bit)
modification_date: 2019-08-06T14:20:14.836000Z
product_uid : 2da05c9e-580a-542c-a426-7e5b93cca6b4
generation_uid : a568b931-30dc-4090-9525-b5a4678e378b
material_package_umid: 0x060A2B340101010501010F201300000033A7C7AED15544D1AC4AC5A8CEFB6F08
timecode : 00:59:30:00
Duration: 01:59:07.60, start: 0.000000, bitrate: 484091 kb/s
Stream #0:0: Video: jpeg2000, yuv422p10le(tv, bt709, progressive), 3840x2160, SAR 1:1 DAR 16:9, 23.98 tbr, 23.98 tbn
Metadata:
file_package_umid: 0x060A2B340101010501010F2013000000FDCB9BEAB59345B9926D6E6A7EC205E1
track_name : MP Picture track
Input #1, mxf, from '\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\hitch_sdr_sky_italy\IMF10544357_HITCH_2D_D_UHD_LB240_XVYCC_2398_TXT_ITA_ITA_DS.mxf':
Metadata:
operational_pattern_ul: 060e2b34.04010101.0d010201.01010100
uid : 9dae8d74-568b-490b-a56d-ea01b162e5eb
company_name : Rohde and Schwarz
product_name : Clipster
product_version : 6.9.1.0
product_version_num: 6.9.1.0.1
toolkit_version_num: 2.38.0.20411.1
application_platform: Windows 8 (64-bit)
modification_date: 2022-05-03T22:45:04.940000Z
product_uid : 11541793-dee2-56c7-b142-13f88b4264b9
generation_uid : 0dfb7915-0316-427c-89a7-7efd58f4d1fc
material_package_umid: 0x060A2B340101010501010F2013000000A0EB6358194B4F0BADA1F35498880DB5
material_package_name: Material Package
timecode : 00:59:30:00
Duration: 02:06:22.49, start: 0.000000, bitrate: 2304 kb/s
Stream #1:0(ita): Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010F201300000038723ACE89734FC680B85F2D7B78FA25
file_package_name: File Package: SMPTE 382M clip wrapping of wave audio
track_name : MP sound track
Output #0, mxf, to '\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\trim.mxf':
Metadata:
operational_pattern_ul: 060e2b34.04010101.0d010201.01010100
uid : 1a566ace-8338-4b8f-a82e-441affdf6970
timecode : 00:59:30:00
material_package_umid: 0x060A2B340101010501010F201300000033A7C7AED15544D1AC4AC5A8CEFB6F08
generation_uid : a568b931-30dc-4090-9525-b5a4678e378b
product_version_num: 5.10.0.19.1
toolkit_version_num: 1.2.0.19.4
application_platform: Windows Server 2008 R2 (64-bit)
modification_date: 2019-08-06T14:20:14.836000Z
product_uid : 2da05c9e-580a-542c-a426-7e5b93cca6b4
encoder : Lavf59.17.101
Stream #0:0: Video: jpeg2000, yuv422p10le(tv, bt709, progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 23.98 tbr, 23.98 tbn
Metadata:
file_package_umid: 0x060A2B340101010501010F2013000000FDCB9BEAB59345B9926D6E6A7EC205E1
track_name : MP Picture track
Stream #0:1(ita): Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s
Metadata:
file_package_umid: 0x060A2B340101010501010F201300000038723ACE89734FC680B85F2D7B78FA25
file_package_name: File Package: SMPTE 382M clip wrapping of wave audio
track_name : MP sound track
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
it says Stream #0:1(ita)
however when I open the CPL with the IMF decoder:
H:\MJPEG2000 DCP Hardsubber (x86) - Final>ffmpeg.exe -f imf -i "\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\hitch_sdr_sky_italy\CPL_IMF10544357_958008_HITCH_D_UHD_LB240_XVYCC_2398_48K_ITA_DS_ENG_DS_ITA_51_TXT_ITA_e945442e-aa35-4961-9b74-7c624fb9d232.xml" -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -c:v copy -c:a copy -f mxf -y "\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\test.mxf"
ffmpeg version git-2022-01-28-f581139854-20220128 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (crosstool-NG 1.24.0.498_5075e1f)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220128
libavutil 57. 18.100 / 57. 18.100
libavcodec 59. 20.100 / 59. 20.100
libavformat 59. 17.101 / 59. 17.101
libavdevice 59. 5.100 / 59. 5.100
libavfilter 8. 25.100 / 8. 25.100
libswscale 6. 5.100 / 6. 5.100
libswresample 4. 4.100 / 4. 4.100
libpostproc 56. 4.100 / 56. 4.100
IMF CPL ContentTitle: Hitch
IMF CPL Id: urn:uuid:e945442e-aa35-4961-9b74-7c624fb9d232
[imf @ 0000025932742a40] Opening '\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\hitch_sdr_sky_italy/ASSETMAP.xml' for reading
[mxf @ 00000259327708c0] local tag 0xdff5 with 0 size
[mxf @ 00000259327708c0] local tag 0xdff4 with 0 size
[mxf @ 00000259327708c0] local tag 0xdff3 with 0 size
[mxf @ 00000259327708c0] local tag 0xdff2 with 0 size
[mxf @ 00000259327708c0] local tag 0xdff5 with 0 size
[mxf @ 00000259327708c0] local tag 0xdff4 with 0 size
[mxf @ 00000259327708c0] local tag 0xdff3 with 0 size
[mxf @ 00000259327708c0] local tag 0xdff2 with 0 size
Input #0, imf, from '\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\hitch_sdr_sky_italy\CPL_IMF10544357_958008_HITCH_D_UHD_LB240_XVYCC_2398_48K_ITA_DS_ENG_DS_ITA_51_TXT_ITA_e945442e-aa35-4961-9b74-7c624fb9d232.xml':
Duration: 02:06:22.49, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: jpeg2000, yuv422p10le(tv, bt709, progressive), 3840x2160, 23.98 tbr, 23.98 tbn
Stream #0:1: Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s
Stream #0:2: Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s
Stream #0:3: Audio: pcm_s24le, 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s
Stream #0:4: Audio: pcm_s24le, 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s
Output #0, mxf, to '\\mibcsrvarca01.pbc.local\Avisynth Server 3\Masterfiles\test.mxf':
Metadata:
encoder : Lavf59.17.101
Stream #0:0: Video: jpeg2000, yuv422p10le(tv, bt709, progressive), 3840x2160, q=2-31, 23.98 tbr, 23.98 tbn
Stream #0:1: Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s (default)
Stream #0:2: Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s
Stream #0:3: Audio: pcm_s24le, 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s
Stream #0:4: Audio: pcm_s24le, 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Stream #0:3 -> #0:3 (copy)
Stream #0:4 -> #0:4 (copy)
it doesn't display the language tag, so something must be wrong with the IMF / FFMpeg integration.
Again, I don't mean in the final package, I mean inside the FFMpeg decoding. In other words, it doesn't matter which container I remux to, it will never ever show up.
Do you know how I can trim a IMF package to send you a sample? The only thing I've been able to trim was the audio file but if I open that directly with -i "file.mxf" it does indeed show (ita), so it's not really a valid test... https://trac.ffmpeg.org/attachment/ticket/9818/trim_1.mxf
@FranceBB Can you give https://github.com/sandflow/ffmpeg-imf/pull/99 a try?
Sure, but it's evening in Europe right now. If you have a build ready I'll try it first thing in the morning tomorrow, otherwise I'll build it tomorrow afternoon as soon as I get a few spare minutes from work.
Sorry for the delay, but yes, your commit seems to be solving the issue, thanks! :)
I have an IMF package with videos and audios and of course the CPL. Video file is a MJPEG2000 BT709 SDR 10bit muxed in mxf The audio files are PCM lossless 24bit 48'000Hz muxed as .mxf To differentiate them, each one has audio tagging inside, so if I use Mediainfo I can see for instance:
<TABLE style="BORDER-TOP: navy 1px solid; BORDER-RIGHT: navy 1px solid; BORDER-BOTTOM: navy 1px solid; BORDER-LEFT: navy 1px solid" cellSpacing=2 cellPadding=1 width="100%" border=0>
General
Audio
Other #1
Other #2
As you can see, there's the language tagging: Language : Italian same goes for other tracks that might have a different language like English:
General
Audio
Other #1
Other #2
so: Language : English however when I do: ``` ffmpeg.exe -f imf -i "D:\Masterfiles\CPL_IMF.xml" -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -c:v copy -c:a copy -f mxf -y "D:\Masterfiles\test.mxf" pause ``` FFMpeg outputs an error in the language tagging, namely: [imf @ 000001d283a12a00] Opening 'D:\Masterfiles\ASSETMAP.xml' for reading [mxf @ 000001d283a689c0] local tag 0xdff5 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff4 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff3 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff2 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff5 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff4 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff3 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff2 with 0 size The whole command line output is: ``` H:\MJPEG2000 DCP Hardsubber (x86) - Final>ffmpeg.exe -f imf -i "D:\Masterfiles\CPL_IMF.xml" -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -c:v copy -c:a copy -f mxf -y "D:\Masterfiles\test.mxf" ffmpeg version git-2022-01-28-f581139854-20220128 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11.2.0 (crosstool-NG 1.24.0.498_5075e1f) configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220128 libavutil 57. 18.100 / 57. 18.100 libavcodec 59. 20.100 / 59. 20.100 libavformat 59. 17.101 / 59. 17.101 libavdevice 59. 5.100 / 59. 5.100 libavfilter 8. 25.100 / 8. 25.100 libswscale 6. 5.100 / 6. 5.100 libswresample 4. 4.100 / 4. 4.100 libpostproc 56. 4.100 / 56. 4.100 IMF CPL ContentTitle: Hitch IMF CPL Id: urn:uuid:e945442e-aa35-4961-9b74-7c624fb9d232 [imf @ 000001d283a12a00] Opening 'D:\Masterfiles\ASSETMAP.xml' for reading [mxf @ 000001d283a689c0] local tag 0xdff5 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff4 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff3 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff2 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff5 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff4 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff3 with 0 size [mxf @ 000001d283a689c0] local tag 0xdff2 with 0 size Input #0, imf, from 'D:\Masterfiles\CPL_IMF.xml': Duration: 02:06:22.49, start: 0.000000, bitrate: 0 kb/s Stream #0:0: Video: jpeg2000, yuv422p10le(tv, bt709, progressive), 3840x2160, 23.98 tbr, 23.98 tbn Stream #0:1: Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s Stream #0:2: Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s Stream #0:3: Audio: pcm_s24le, 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s Stream #0:4: Audio: pcm_s24le, 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s Output #0, mxf, to 'D:\Masterfiles\test.mxf': Metadata: encoder : Lavf59.17.101 Stream #0:0: Video: jpeg2000, yuv422p10le(tv, bt709, progressive), 3840x2160, q=2-31, 23.98 tbr, 23.98 tbn Stream #0:1: Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s (default) Stream #0:2: Audio: pcm_s24le, 48000 Hz, downmix, s32 (24 bit), 2304 kb/s Stream #0:3: Audio: pcm_s24le, 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s Stream #0:4: Audio: pcm_s24le, 48000 Hz, 5.1(side), s32 (24 bit), 6912 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Stream #0:2 -> #0:2 (copy) Stream #0:3 -> #0:3 (copy) Stream #0:4 -> #0:4 (copy) Press [q] to stop, [?] for help frame= 3987 fps=793 q=-1.0 size= 3678208kB time=00:02:46.29 bitrate=181199.6kbits/s speed=33.1x ``` and indeed the final file lacks the audio tagging:
General
Video
Audio #1
Audio #2
Audio #3
Audio #4
Other #1
Other #2
Other #3
Changing the remux to mov doesn't improve things either: ``` ffmpeg.exe -f imf -i "D:\Masterfiles\CPL_IMF.xml" -map 0:0 -map 0:1 -map 0:2 -map 0:3 -map 0:4 -c:v copy -c:a copy -f mov -y "D:\Masterfiles\test.mov" pause ```
General
Video
Audio #1
Audio #2
Audio #3
Audio #4