Opened 3 months ago

Last modified 8 weeks ago

#9818 new enhancement

Introduce support for MCA sub-descriptors in mxf and mov container

Reported by: Francesco Bucciantini Owned by:
Priority: wish Component: ffmpeg
Version: git-master Keywords: mxf
Cc: Francesco Bucciantini Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: Audio tagging in mxf isn't passed through.

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:

General
Complete name :	Test.mxf
Format :	MXF
Format version :	1.3
Format profile :	OP-1a
Format settings :	Closed / Complete
File size :	6.10 GiB
Duration :	2 h 6 min
Overall bit rate :	6 912 kb/s
Package name :	Material Package / File Package: SMPTE 382M clip wrapping of wave audio
Encoded date :	2022-05-03 22:48:00.768
Writing application :	Rohde and Schwarz Clipster 6.9.1.0.1
Writing library :	Windows 8 (64-bit) 2.38.0.20411.1

Audio
ID :	2
Format :	PCM
Format settings :	Little
Format settings, wrapping mode :	Clip (BWF)
Codec ID :	0D01030102060200
Duration :	2 h 6 min
Bit rate mode :	Constant
Bit rate :	6 912 kb/s
Channel(s) :	6 channels
Channel layout :	L R C LFE Ls Rs
Sampling rate :	48.0 kHz
Bit depth :	24 bits
Stream size :	6.10 GiB (100%)
Title :	FP Sound track
Language :	Italian
Locked :	Yes
MCA Title :	MCA Title
MCA Title Version :	MCA Title Version
MCA Audio Content Kind :	MCA Audio Content Kind
MCA Audio Element Kind :	MCA Audio Element Kind

Other #1
ID :	1-Material
Type :	Time code
Format :	MXF TC
Frame rate :	24.000 FPS
Time code of first frame :	00:59:30:00
Time code settings :	Material Package
Time code, striped :	Yes
Title :	Timecode track

Other #2
ID :	1-Source
Type :	Time code
Format :	MXF TC
Frame rate :	24.000 FPS
Time code of first frame :	00:59:30:00
Time code settings :	Source Package
Time code, striped :	Yes
Title :	Timecode track

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
Complete name :	Test2.mxf
Format :	MXF
Format version :	1.3
Format profile :	OP-1a
Format settings :	Closed / Complete
File size :	6.10 GiB
Duration :	2 h 6 min
Overall bit rate :	6 912 kb/s
Package name :	Material Package / File Package: SMPTE 382M clip wrapping of wave audio
Encoded date :	2022-05-03 22:48:00.768
Writing application :	Rohde and Schwarz Clipster 6.9.1.0.1
Writing library :	Windows 8 (64-bit) 2.38.0.20411.1

Audio
ID :	2
Format :	PCM
Format settings :	Little
Format settings, wrapping mode :	Clip (BWF)
Codec ID :	0D01030102060200
Duration :	2 h 6 min
Bit rate mode :	Constant
Bit rate :	6 912 kb/s
Channel(s) :	6 channels
Channel layout :	L R C LFE Ls Rs
Sampling rate :	48.0 kHz
Bit depth :	24 bits
Stream size :	6.10 GiB (100%)
Title :	FP Sound track
Language :	English
Locked :	Yes

Other #1
ID :	1-Material
Type :	Time code
Format :	MXF TC
Frame rate :	24.000 FPS
Time code of first frame :	00:59:30:00
Time code settings :	Material Package
Time code, striped :	Yes
Title :	Timecode track

Other #2
ID :	1-Source
Type :	Time code
Format :	MXF TC
Frame rate :	24.000 FPS
Time code of first frame :	00:59:30:00
Time code settings :	Source Package
Time code, striped :	Yes
Title :	Timecode track

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
Complete name :	D:\Masterfiles\test.mxf
Format :	MXF
Format version :	1.3
Format profile :	OP-1a
Format settings :	Closed / Complete
File size :	3.64 GiB
Duration :	2 min 52 s
Overall bit rate :	181 Mb/s
Encoded date :	0-00-00 00:00:00.000
Writing application :	FFmpeg OP1a Muxer 59.17.101.0.0
Writing library :	Lavf (mingw32) 59.17.101.0.0

Video
ID :	2
Format :	JPEG 2000
Format profile :	BCS@L5
Format settings, wrapping mode :	Frame
Codec ID :	0D010301020C0100-0401020203010100
Duration :	2 min 52 s
Bit rate :	163 Mb/s
Width :	3 840 pixels
Height :	2 160 pixels
Display aspect ratio :	16:9
Frame rate :	23.976 (24000/1001) FPS
Color space :	YUV
Chroma subsampling :	4:2:2
Bit depth :	10 bits
Scan type :	Progressive
Bits/(Pixel*Frame) :	0.819
Stream size :	3.27 GiB (90%)
Color range :	Limited
Color primaries :	BT.709
Transfer characteristics :	BT.709
Matrix coefficients :	BT.709

Audio #1
ID :	3
Format :	PCM
Format settings :	Little
Format settings, wrapping mode :	Frame (AES)
Codec ID :	0D01030102060300
Duration :	2 min 52 s
Bit rate mode :	Constant
Bit rate :	2 304 kb/s
Channel(s) :	2 channels
Sampling rate :	48.0 kHz
Frame rate :	23.976 FPS (2002 SPF)
Bit depth :	24 bits
Stream size :	47.4 MiB (1%)
Locked :	Yes

Audio #2
ID :	4
Format :	PCM
Format settings :	Little
Format settings, wrapping mode :	Frame (AES)
Codec ID :	0D01030102060300
Duration :	2 min 52 s
Bit rate mode :	Constant
Bit rate :	2 304 kb/s
Channel(s) :	2 channels
Sampling rate :	48.0 kHz
Frame rate :	23.976 FPS (2002 SPF)
Bit depth :	24 bits
Stream size :	47.4 MiB (1%)
Locked :	Yes

Audio #3
ID :	5
Format :	PCM
Format settings :	Little
Format settings, wrapping mode :	Frame (AES)
Codec ID :	0D01030102060300
Duration :	2 min 52 s
Bit rate mode :	Constant
Bit rate :	6 912 kb/s
Channel(s) :	6 channels
Sampling rate :	48.0 kHz
Frame rate :	23.976 FPS (2002 SPF)
Bit depth :	24 bits
Stream size :	142 MiB (4%)
Locked :	Yes

Audio #4
ID :	6
Format :	PCM
Format settings :	Little
Format settings, wrapping mode :	Frame (AES)
Codec ID :	0D01030102060300
Duration :	2 min 52 s
Bit rate mode :	Constant
Bit rate :	6 912 kb/s
Channel(s) :	6 channels
Sampling rate :	48.0 kHz
Frame rate :	23.976 FPS (2002 SPF)
Bit depth :	24 bits
Stream size :	142 MiB (4%)
Locked :	Yes

Other #1
ID :	1-Material
Type :	Time code
Format :	MXF TC
Frame rate :	24.000 FPS
Time code of first frame :	00:00:00:00
Time code settings :	Material Package
Time code, striped :	Yes

Other #2
ID :	1-Source
Type :	Time code
Format :	MXF TC
Frame rate :	24.000 FPS
Time code of first frame :	00:00:00:00
Time code settings :	Source Package
Time code, striped :	Yes

Other #3
Type :	Time code
Format :	SMPTE TC
Muxing mode :	SDTI
Frame rate :	24.000 FPS
Time code of first frame :	00:00:00:00

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
Complete name :	D:\Masterfiles\test.mov
Format :	MPEG-4
Format profile :	QuickTime
Codec ID :	qt 0000.02 (qt )
File size :	2.06 GiB
Duration :	1 min 42 s
Overall bit rate mode :	Variable
Overall bit rate :	173 Mb/s
Writing application :	Lavf59.17.101

Video
ID :	1
Format :	JPEG 2000
Codec ID :	mjp2
Duration :	1 min 42 s
Bit rate mode :	Variable
Bit rate :	155 Mb/s
Width :	3 840 pixels
Height :	2 160 pixels
Display aspect ratio :	16:9
Frame rate mode :	Constant
Frame rate :	23.976 (24000/1001) FPS
Color space :	YUV
Scan type :	Progressive
Bits/(Pixel*Frame) :	0.778
Stream size :	1.84 GiB (89%)
Color primaries :	BT.709
Transfer characteristics :	BT.709
Matrix coefficients :	BT.709

Audio #1
ID :	2
Format :	PCM
Format settings :	Little / Signed
Codec ID :	in24
Duration :	1 min 42 s
Bit rate mode :	Constant
Bit rate :	2 304 kb/s
Channel(s) :	2 channels
Channel layout :	Lt Rt
Sampling rate :	48.0 kHz
Bit depth :	24 bits
Stream size :	28.1 MiB (1%)
Default :	Yes
Alternate group :	1

Audio #2
ID :	3
Format :	PCM
Format settings :	Little / Signed
Codec ID :	in24
Duration :	1 min 42 s
Bit rate mode :	Constant
Bit rate :	2 304 kb/s
Channel(s) :	2 channels
Channel layout :	Lt Rt
Sampling rate :	48.0 kHz
Bit depth :	24 bits
Stream size :	28.1 MiB (1%)
Default :	No
Alternate group :	1

Audio #3
ID :	4
Format :	PCM
Format settings :	Little / Signed
Codec ID :	in24
Duration :	1 min 42 s
Bit rate mode :	Constant
Bit rate :	6 912 kb/s
Channel(s) :	6 channels
Channel layout :	L R C LFE Ls Rs
Sampling rate :	48.0 kHz
Bit depth :	24 bits
Stream size :	84.3 MiB (4%)
Default :	No
Alternate group :	1

Audio #4
ID :	5
Format :	PCM
Format settings :	Little / Signed
Codec ID :	in24
Duration :	1 min 42 s
Bit rate mode :	Constant
Bit rate :	6 912 kb/s
Channel(s) :	6 channels
Channel layout :	L R C LFE Ls Rs
Sampling rate :	48.0 kHz
Bit depth :	24 bits
Stream size :	84.2 MiB (4%)
Default :	No
Alternate group :	1

This is the dump of the source mxf files: https://github.com/sandflow/ffmpeg-imf/files/8959600/Source.MXF.Dump.zip

It looks like FFmpeg does not support writing MCA sub-descriptors, which contain the language information:

https://github.com/FFmpeg/FFmpeg/blob/fed07efcde72824ac1ada80d4af4e91ac4fcfc14/libavformat/mxfenc.c#L1430

How to reproduce:

% ffmpeg 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 2022-01-28-f581139854-20220128
built on 2022-01-28

Attachments (1)

trim_1.mxf (1.8 MB ) - added by Francesco Bucciantini 3 months ago.
Audio File with Italian language tag

Download all attachments as: .zip

Change History (9)

comment:1 by Tomas Härdin, 3 months ago

Please attach a cut down sample file

mxfdec.c has MCA support since 2021-11-25

mxfenc.c indeed does not support MCA

by Francesco Bucciantini, 3 months ago

Attachment: trim_1.mxf added

Audio File with Italian language tag

comment:2 by Francesco Bucciantini, 3 months ago

I've added the file, however, as I said, FFmpeg does not support writing MCA sub-descriptors, which contain the language information and you confirmed my statement:

mxfdec.c has MCA support (so it can read MCA language tagging)
mxfenc.c does not support MCA (so it cannot write it or pass it to the finally remuxed mxf file)

:(

comment:3 by Francesco Bucciantini, 3 months ago

About the IMF, I wouldn't know how to trim an IMF package to be honest, but while decoding the mxf file does indeed make the info being displayed in FFMpeg, it doesn't when it's opened by the CPL IMF decoder:

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.

Do you know how I can trim a IMF package?

Last edited 3 months ago by Francesco Bucciantini (previous) (diff)

comment:4 by Pierre-Anthony Lemieux, 3 months ago

It looks like imfdec.c does not copy input stream metadata, which probably contains the language code:

https://github.com/FFmpeg/FFmpeg/blob/2a3640de84975398b1169d29530274cdd38b3939/libavformat/imfdec.c#L560

Perhaps copy_stream_props() from concatdec.c can be reused.

https://github.com/FFmpeg/FFmpeg/blob/2a3640de84975398b1169d29530274cdd38b3939/libavformat/concatdec.c#L172

comment:5 by Pierre-Anthony Lemieux, 3 months ago

comment:6 by Francesco Bucciantini, 3 months ago

Yep, the proposed fix solves the issue.
Thanks!

comment:7 by Pierre-Anthony Lemieux, 3 months ago

Patch submitted: http://ffmpeg.org/pipermail/ffmpeg-devel/2022-July/298490.html

This addresses the IMF demuxer issue not the absence of MCA support in the MXF muxer.

in reply to:  7 comment:8 by Pierre-Anthony Lemieux, 8 weeks ago

Replying to Pierre-Anthony Lemieux:

Patch submitted: http://ffmpeg.org/pipermail/ffmpeg-devel/2022-July/298490.html

This addresses the IMF demuxer issue not the absence of MCA support in the MXF muxer.

imfdec.c now passes language information:

https://github.com/FFmpeg/FFmpeg/commit/d5b46fa07d946ce3ef872636338b0f4252f21424

Note: See TracTickets for help on using tickets.