diff mbox series

[FFmpeg-devel] mxfdec.c: prefer metadata from Footer

Message ID 20210626082010.11899-1-emcodem@ffastrans.com
State New
Headers show
Series [FFmpeg-devel] mxfdec.c: prefer metadata from Footer | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate fail Make fate failed
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate warning Make fate failed

Commit Message

emcodem June 26, 2021, 8:20 a.m. UTC
In case there is a Footer, regarding to SMPTE 377 all versions, the metadata in Footer shall be correct (where in Header it can be incomplete)..
If there is no footer (stream, truncated...) it will still work as usual.
Tested with a huge set of files and compared old/new ffprobes, it will not change lots of metadata, mainly duration and in some cases start timecode.
Without this change, especially Duration would be often inaccurate because it is unknown in header and calculated from bitrate.

The new sample files should be added to \fate-suite\mxf, as i do not have an account to upload the files, i shared them on wetransfer:

https://we.tl/t-MVmyG2mZHq

omneon_6.4.1.0.1_xdcam_truncated.mxf
An original Omneon File from an older Version, file is truncated. It shall prove that Metadata is being parsed even when there is no Footer.

omneon_8.3.0.0_xdcam_startc_footer.mxf
An original Omneon File from a recent Version with "better" Metadata in Footer than in Header. I needed to hexedit this file and set the MP and SP start timecode in header to 0. 
This test is for proving that metadata from Footer is preferred.

---
 libavformat/mxfdec.c                      |   2 +-
 tests/fate/mxf.mak                        |  10 +
 tests/ref/fate/mxf-probe-xdcamhd-oit      | 442 ++++++++++++++++++++++
 tests/ref/fate/mxf-probe-xdcamhd-tcfooter | 442 ++++++++++++++++++++++
 4 files changed, 895 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/fate/mxf-probe-xdcamhd-oit
 create mode 100644 tests/ref/fate/mxf-probe-xdcamhd-tcfooter

Comments

Marton Balint June 27, 2021, 10:03 a.m. UTC | #1
On Sat, 26 Jun 2021, emcodem wrote:

> In case there is a Footer, regarding to SMPTE 377 all versions, the metadata in Footer shall be correct (where in Header it can be incomplete)..
> If there is no footer (stream, truncated...) it will still work as usual.
> Tested with a huge set of files and compared old/new ffprobes, it will not change lots of metadata, mainly duration and in some cases start timecode.
> Without this change, especially Duration would be often inaccurate because it is unknown in header and calculated from bitrate.
>
> The new sample files should be added to \fate-suite\mxf, as i do not have an account to upload the files, i shared them on wetransfer:
>
> https://we.tl/t-MVmyG2mZHq
>
> omneon_6.4.1.0.1_xdcam_truncated.mxf
> An original Omneon File from an older Version, file is truncated. It shall prove that Metadata is being parsed even when there is no Footer.
>
> omneon_8.3.0.0_xdcam_startc_footer.mxf
> An original Omneon File from a recent Version with "better" Metadata in Footer than in Header. I needed to hexedit this file and set the MP and SP start timecode in header to 0.
> This test is for proving that metadata from Footer is preferred.
>
> ---
> libavformat/mxfdec.c                      |   2 +-
> tests/fate/mxf.mak                        |  10 +
> tests/ref/fate/mxf-probe-xdcamhd-oit      | 442 ++++++++++++++++++++++
> tests/ref/fate/mxf-probe-xdcamhd-tcfooter | 442 ++++++++++++++++++++++
> 4 files changed, 895 insertions(+), 1 deletion(-)
> create mode 100644 tests/ref/fate/mxf-probe-xdcamhd-oit
> create mode 100644 tests/ref/fate/mxf-probe-xdcamhd-tcfooter
>
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index 7b40076fb4..a7f552c753 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -1402,7 +1402,7 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
>
>     if (!strong_ref)
>         return NULL;
> -    for (i = 0; i < mxf->metadata_sets_count; i++) {
> +    for (i = mxf->metadata_sets_count-1; i >= 0; i--) {

Do we have to store all metadata in the first place? Why not do the 
decision which one is better when adding the metadata set? Order of 
parsing depends on the file, we usually do header, footer and then 
backwards the partitions. So after your patch metadata in the second 
partition will have priority over footer, which is also against spec I 
believe.

Regards,
Marton



>         if (!memcmp(*strong_ref, mxf->metadata_sets[i]->uid, 16) &&
>             (type == AnyType || mxf->metadata_sets[i]->type == type)) {
>             return mxf->metadata_sets[i];
> diff --git a/tests/fate/mxf.mak b/tests/fate/mxf.mak
> index 3a1096176f..1b7be46c64 100644
> --- a/tests/fate/mxf.mak
> +++ b/tests/fate/mxf.mak
> @@ -37,6 +37,16 @@ FATE_MXF_PROBE-$(call ENCDEC2, PRORES, PCM_S24LE, MXF) += fate-mxf-probe-applehd
> fate-mxf-probe-applehdr10: SRC = $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf
> fate-mxf-probe-applehdr10: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" | sed -e "s/yuv422p10../yuv422p10/"
>
> +# openincomplete Header, truncated
> +FATE_MXF_PROBE-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-probe-xdcamhd-oit
> +fate-mxf-probe-xdcamhd-oit: SRC = $(TARGET_SAMPLES)/mxf/omneon_6.4.1.0.1_xdcam_truncated.mxf
> +fate-mxf-probe-xdcamhd-oit: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
> +
> +# openincomplete Header, starttc in header 0 but Footer MP 10:11:17:21, SP 10:11:17:17
> +FATE_MXF_PROBE-$(call ENCDEC2, MPEG2VIDEO, PCM_S24LE, MXF) += fate-mxf-probe-xdcamhd-tcfooter
> +fate-mxf-probe-xdcamhd-tcfooter: SRC = $(TARGET_SAMPLES)/mxf/omneon_8.3.0.0_xdcam_startc_footer.mxf
> +fate-mxf-probe-xdcamhd-tcfooter: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
> +
> FATE_MXF_REEL_NAME-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-reel_name
> fate-mxf-reel_name: $(SAMPLES)/mxf/Sony-00001.mxf
> fate-mxf-reel_name: CMD = md5 -y -i $(TARGET_SAMPLES)/mxf/Sony-00001.mxf  -c copy -timecode 00:00:00:00 -metadata "reel_name=test_reel" -fflags +bitexact -f mxf
> diff --git a/tests/ref/fate/mxf-probe-xdcamhd-oit b/tests/ref/fate/mxf-probe-xdcamhd-oit
> new file mode 100644
> index 0000000000..040a4e0fba
> --- /dev/null
> +++ b/tests/ref/fate/mxf-probe-xdcamhd-oit
> @@ -0,0 +1,442 @@
> +[STREAM]
> +index=0
> +codec_name=mpeg2video
> +profile=0
> +codec_type=video
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +width=1920
> +height=1080
> +coded_width=0
> +coded_height=0
> +closed_captions=0
> +has_b_frames=1
> +sample_aspect_ratio=1:1
> +display_aspect_ratio=16:9
> +pix_fmt=yuv422p
> +level=2
> +color_range=tv
> +color_space=unknown
> +color_transfer=bt709
> +color_primaries=unknown
> +chroma_location=topleft
> +field_order=tt
> +refs=1
> +id=N/A
> +r_frame_rate=25/1
> +avg_frame_rate=25/1
> +time_base=1/25
> +start_pts=0
> +start_time=0.000000
> +duration_ts=6
> +duration=0.240000
> +bit_rate=50000000
> +max_bit_rate=N/A
> +bits_per_raw_sample=N/A
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[SIDE_DATA]
> +side_data_type=CPB properties
> +max_bitrate=50000000
> +min_bitrate=0
> +avg_bitrate=0
> +buffer_size=12484608
> +vbv_delay=-1
> +[/SIDE_DATA]
> +[/STREAM]
> +[STREAM]
> +index=1
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=11596
> +duration=0.241583
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[/STREAM]
> +[STREAM]
> +index=2
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=11596
> +duration=0.241583
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[/STREAM]
> +[STREAM]
> +index=3
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=11596
> +duration=0.241583
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[/STREAM]
> +[STREAM]
> +index=4
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=11596
> +duration=0.241583
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[/STREAM]
> +[STREAM]
> +index=5
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=11596
> +duration=0.241583
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[/STREAM]
> +[STREAM]
> +index=6
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=11596
> +duration=0.241583
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[/STREAM]
> +[STREAM]
> +index=7
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=11596
> +duration=0.241583
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[/STREAM]
> +[STREAM]
> +index=8
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=11596
> +duration=0.241583
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
> +[/STREAM]
> +[FORMAT]
> +format_name=mxf
> +duration=0.241583
> +bit_rate=59674662
> +TAG:operational_pattern_ul=060e2b34.04010101.0d010201.01010900
> +TAG:uid=8033c057-9ad9-e111-aa7e-00d028113d2c
> +TAG:generation_uid=9433c057-9ad9-e111-96cf-00d028113d2c
> +TAG:company_name=Omneon Inc.
> +TAG:product_name=Omneon Media Subsystem
> +TAG:modification_date=2012-07-29T16:27:51.820000Z
> +TAG:product_version=6.4.1.0.release
> +TAG:product_version_num=6.4.1.0.1
> +TAG:application_platform=Omneon Media Api (mqx)
> +TAG:product_uid=00000000-0000-0010-8000-050e0b010602
> +TAG:material_package_umid=0x060A2B340101010501010D2313001BDF4438C0579AD9E1119C8800D028113D2C
> +TAG:timecode=18:27:53:21
> +[/FORMAT]
> diff --git a/tests/ref/fate/mxf-probe-xdcamhd-tcfooter b/tests/ref/fate/mxf-probe-xdcamhd-tcfooter
> new file mode 100644
> index 0000000000..710cf616b5
> --- /dev/null
> +++ b/tests/ref/fate/mxf-probe-xdcamhd-tcfooter
> @@ -0,0 +1,442 @@
> +[STREAM]
> +index=0
> +codec_name=mpeg2video
> +profile=0
> +codec_type=video
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +width=1920
> +height=1080
> +coded_width=0
> +coded_height=0
> +closed_captions=0
> +has_b_frames=1
> +sample_aspect_ratio=1:1
> +display_aspect_ratio=16:9
> +pix_fmt=yuv422p
> +level=2
> +color_range=tv
> +color_space=bt709
> +color_transfer=bt709
> +color_primaries=bt709
> +chroma_location=topleft
> +field_order=tt
> +refs=1
> +id=N/A
> +r_frame_rate=25/1
> +avg_frame_rate=25/1
> +time_base=1/25
> +start_pts=0
> +start_time=0.000000
> +duration_ts=13
> +duration=0.520000
> +bit_rate=50000000
> +max_bit_rate=N/A
> +bits_per_raw_sample=N/A
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[SIDE_DATA]
> +side_data_type=CPB properties
> +max_bitrate=50000000
> +min_bitrate=0
> +avg_bitrate=0
> +buffer_size=17825792
> +vbv_delay=-1
> +[/SIDE_DATA]
> +[/STREAM]
> +[STREAM]
> +index=1
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=24960
> +duration=0.520000
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[/STREAM]
> +[STREAM]
> +index=2
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=24960
> +duration=0.520000
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[/STREAM]
> +[STREAM]
> +index=3
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=24960
> +duration=0.520000
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[/STREAM]
> +[STREAM]
> +index=4
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=24960
> +duration=0.520000
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[/STREAM]
> +[STREAM]
> +index=5
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=24960
> +duration=0.520000
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[/STREAM]
> +[STREAM]
> +index=6
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=24960
> +duration=0.520000
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[/STREAM]
> +[STREAM]
> +index=7
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=24960
> +duration=0.520000
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[/STREAM]
> +[STREAM]
> +index=8
> +codec_name=pcm_s24le
> +profile=unknown
> +codec_type=audio
> +codec_tag_string=[0][0][0][0]
> +codec_tag=0x0000
> +sample_fmt=s32
> +sample_rate=48000
> +channels=1
> +channel_layout=unknown
> +bits_per_sample=24
> +id=N/A
> +r_frame_rate=0/0
> +avg_frame_rate=0/0
> +time_base=1/48000
> +start_pts=0
> +start_time=0.000000
> +duration_ts=24960
> +duration=0.520000
> +bit_rate=1152000
> +max_bit_rate=N/A
> +bits_per_raw_sample=24
> +nb_frames=N/A
> +nb_read_frames=N/A
> +nb_read_packets=N/A
> +DISPOSITION:default=0
> +DISPOSITION:dub=0
> +DISPOSITION:original=0
> +DISPOSITION:comment=0
> +DISPOSITION:lyrics=0
> +DISPOSITION:karaoke=0
> +DISPOSITION:forced=0
> +DISPOSITION:hearing_impaired=0
> +DISPOSITION:visual_impaired=0
> +DISPOSITION:clean_effects=0
> +DISPOSITION:attached_pic=0
> +DISPOSITION:timed_thumbnails=0
> +DISPOSITION:captions=0
> +DISPOSITION:descriptions=0
> +DISPOSITION:metadata=0
> +DISPOSITION:dependent=0
> +DISPOSITION:still_image=0
> +TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
> +[/STREAM]
> +[FORMAT]
> +format_name=mxf
> +duration=0.520000
> +bit_rate=82212369
> +TAG:operational_pattern_ul=060e2b34.04010101.0d010201.01010900
> +TAG:application_platform=Omneon Media Api (mqx)
> +TAG:uid=6e0aa7ca-8bbf-1b1e-a5b4-00d028113d5c
> +TAG:generation_uid=780aa7ca-8bbf-1b1e-93f8-00d028113d5c
> +TAG:company_name=Omneon Inc.
> +TAG:product_name=Omneon Media Subsystem
> +TAG:modification_date=2021-05-28T08:07:48.620000Z
> +TAG:product_version=8.3.0.0.release
> +TAG:product_version_num=8.3.0.0.1
> +TAG:product_uid=00000000-0000-1000-8000-050e0b010602
> +TAG:material_package_umid=0x060A2B340101010501010D2313009472DE0DA7CA8BBF1B1EB07100D028113D5C
> +TAG:timecode=10:11:17:21
> +[/FORMAT]
> -- 
> 2.17.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
Tomas Härdin June 27, 2021, 10:39 a.m. UTC | #2
sön 2021-06-27 klockan 12:03 +0200 skrev Marton Balint:
> 
> On Sat, 26 Jun 2021, emcodem wrote:
> 
> > In case there is a Footer, regarding to SMPTE 377 all versions, the metadata in Footer shall be correct (where in Header it can be incomplete)..
> > If there is no footer (stream, truncated...) it will still work as usual.
> > Tested with a huge set of files and compared old/new ffprobes, it will not change lots of metadata, mainly duration and in some cases start timecode.
> > Without this change, especially Duration would be often inaccurate because it is unknown in header and calculated from bitrate.
> > 
> > The new sample files should be added to \fate-suite\mxf, as i do not have an account to upload the files, i shared them on wetransfer:
> > 
> > https://we.tl/t-MVmyG2mZHq
> > 
> > omneon_6.4.1.0.1_xdcam_truncated.mxf
> > An original Omneon File from an older Version, file is truncated. It shall prove that Metadata is being parsed even when there is no Footer.
> > 
> > omneon_8.3.0.0_xdcam_startc_footer.mxf
> > An original Omneon File from a recent Version with "better" Metadata in Footer than in Header. I needed to hexedit this file and set the MP and SP start timecode in header to 0.
> > This test is for proving that metadata from Footer is preferred.
> > 
> > ---
> > libavformat/mxfdec.c                      |   2 +-
> > tests/fate/mxf.mak                        |  10 +
> > tests/ref/fate/mxf-probe-xdcamhd-oit      | 442 ++++++++++++++++++++++
> > tests/ref/fate/mxf-probe-xdcamhd-tcfooter | 442 ++++++++++++++++++++++
> > 4 files changed, 895 insertions(+), 1 deletion(-)
> > create mode 100644 tests/ref/fate/mxf-probe-xdcamhd-oit
> > create mode 100644 tests/ref/fate/mxf-probe-xdcamhd-tcfooter
> > 
> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > index 7b40076fb4..a7f552c753 100644
> > --- a/libavformat/mxfdec.c
> > +++ b/libavformat/mxfdec.c
> > @@ -1402,7 +1402,7 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
> > 
> >     if (!strong_ref)
> >         return NULL;
> > -    for (i = 0; i < mxf->metadata_sets_count; i++) {
> > +    for (i = mxf->metadata_sets_count-1; i >= 0; i--) {
> 
> Do we have to store all metadata in the first place? Why not do the 
> decision which one is better when adding the metadata set?

This could be done, but it entails rewriting much of the demuxer

> Order of 
> parsing depends on the file, we usually do header, footer and then 
> backwards the partitions. So after your patch metadata in the second 
> partition will have priority over footer, which is also against spec I 
> believe.

I was going to say this is not right because mxf_read_partition_pack()
will reverse the order in which partitions are added when parsing
backwards, so everything ends up in the correct order. But this doesn't
apply to mxf->metadata_sets, only mxf->partitions..

We've had a similar discussion on here roughly a month ago. There's a
bit of finessing around the order in which to prefer any one metadata
set. IIRC something like: FooterPartition, then any Complete non-footer 
Partition, then the latest OpenPartition

/Tomas
Marton Balint June 27, 2021, 6:12 p.m. UTC | #3
On Sun, 27 Jun 2021, Tomas Härdin wrote:

> sön 2021-06-27 klockan 12:03 +0200 skrev Marton Balint:
>> 
>> On Sat, 26 Jun 2021, emcodem wrote:
>> 
>> > In case there is a Footer, regarding to SMPTE 377 all versions, the metadata in Footer shall be correct (where in Header it can be incomplete)..
>> > If there is no footer (stream, truncated...) it will still work as usual.
>> > Tested with a huge set of files and compared old/new ffprobes, it will not change lots of metadata, mainly duration and in some cases start timecode.
>> > Without this change, especially Duration would be often inaccurate because it is unknown in header and calculated from bitrate.
>> > 
>> > The new sample files should be added to \fate-suite\mxf, as i do not have an account to upload the files, i shared them on wetransfer:
>> > 
>> > https://we.tl/t-MVmyG2mZHq
>> > 
>> > omneon_6.4.1.0.1_xdcam_truncated.mxf
>> > An original Omneon File from an older Version, file is truncated. It shall prove that Metadata is being parsed even when there is no Footer.
>> > 
>> > omneon_8.3.0.0_xdcam_startc_footer.mxf
>> > An original Omneon File from a recent Version with "better" Metadata in Footer than in Header. I needed to hexedit this file and set the MP and SP start timecode in header to 0.
>> > This test is for proving that metadata from Footer is preferred.
>> > 
>> > ---
>> > libavformat/mxfdec.c                      |   2 +-
>> > tests/fate/mxf.mak                        |  10 +
>> > tests/ref/fate/mxf-probe-xdcamhd-oit      | 442 ++++++++++++++++++++++
>> > tests/ref/fate/mxf-probe-xdcamhd-tcfooter | 442 ++++++++++++++++++++++
>> > 4 files changed, 895 insertions(+), 1 deletion(-)
>> > create mode 100644 tests/ref/fate/mxf-probe-xdcamhd-oit
>> > create mode 100644 tests/ref/fate/mxf-probe-xdcamhd-tcfooter
>> > 
>> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
>> > index 7b40076fb4..a7f552c753 100644
>> > --- a/libavformat/mxfdec.c
>> > +++ b/libavformat/mxfdec.c
>> > @@ -1402,7 +1402,7 @@ static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
>> > 
>> >     if (!strong_ref)
>> >         return NULL;
>> > -    for (i = 0; i < mxf->metadata_sets_count; i++) {
>> > +    for (i = mxf->metadata_sets_count-1; i >= 0; i--) {
>> 
>> Do we have to store all metadata in the first place? Why not do the 
>> decision which one is better when adding the metadata set?
>
> This could be done, but it entails rewriting much of the demuxer

Why? I though it is enough if you store the partition number in the 
metadata set, that way you should be able to compare if the existing 
metadata set is better than the current one when adding a new metadata 
set. Or am I missing something?

Thanks,
Marton

>
>> Order of 
>> parsing depends on the file, we usually do header, footer and then 
>> backwards the partitions. So after your patch metadata in the second 
>> partition will have priority over footer, which is also against spec I 
>> believe.
>
> I was going to say this is not right because mxf_read_partition_pack()
> will reverse the order in which partitions are added when parsing
> backwards, so everything ends up in the correct order. But this doesn't
> apply to mxf->metadata_sets, only mxf->partitions..
>
> We've had a similar discussion on here roughly a month ago. There's a
> bit of finessing around the order in which to prefer any one metadata
> set. IIRC something like: FooterPartition, then any Complete non-footer 
> Partition, then the latest OpenPartition
>
> /Tomas
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
emcodem June 27, 2021, 7:28 p.m. UTC | #4
Am 2021-06-27 20:12, schrieb Marton Balint:
> On Sun, 27 Jun 2021, Tomas Härdin wrote:

>>> Order of parsing depends on the file, we usually do header, footer 
>>> and then backwards the partitions. So after your patch metadata in 
>>> the second partition will have priority over footer, which is also 
>>> against spec I believe.
>> 
>> I was going to say this is not right because mxf_read_partition_pack()
>> will reverse the order in which partitions are added when parsing
>> backwards, so everything ends up in the correct order. But this 
>> doesn't
>> apply to mxf->metadata_sets, only mxf->partitions..
>> 
>> We've had a similar discussion on here roughly a month ago. There's a
>> bit of finessing around the order in which to prefer any one metadata
>> set. IIRC something like: FooterPartition, then any Complete 
>> non-footer Partition, then the latest OpenPartition
>> 
>> /Tomas

My original patch a month ago was more like this "decision" approach: 
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20210524103027.30367-1-emcodem@ffastrans.com/
I basically only wanted to correct a case where the starttc was 0 in 
header but the correct value in footer. Tomas in the chat then came up 
with the idea that it could work for all metadata, so i changed my stuff 
and tested the outcome on multiple thousand files containing about 150 
different flavours. It turned out that in all cases where we had a new 
metadata value, it was always more accurate than before.

"Comaring and Deciding" cannot be done in a very general way, there 
would be some special cases, like the Starttc: SMPTE 377 says whenever 
some value is unknown for the encoder, it shall put the "distinguished 
value" as a placeholder. But for the starttimecode (and many other 
values), it does not define such a distinguished value. Which makes 
sense because it feels kind of impossible that the encoder does not know 
the starttimecode at the start of recording. So one might argue that 
what i am doing is supporting the files of a broke encoder version.
I just fear that this "Compare and decide" approach would end up with 
lots of special cases.

SMPTE 377m 2009, 7.5:
MXF decoders should always use Header Metadata from a Closed Partition. 
When processing files that contain
updated Header Metadata repetitions and when a Closed Partition 
containing Header Metadata is not available,
MXF decoders should use the repetition of a Header Metadata Set with the 
Generation UID value that equals
the This Generation UID Property of the Identification Set at the 
highest index in the Identifications Property of
the Preface Set. All other versions of the same Header Metadata Set 
should be considered outdated.

Most important: i still think this version of the patch is good in 
general. Taking the Values from a possible Header Metadata Repetition in 
a Body IMHO does not directly "violate the rules" and in worst case it 
would spit out the same value that it does now (without this patch). The 
standard seems to say "should" instead of "must".

So now the question for me is if Tomas maybe now prefers my initial 
patch, if that's so, i'd send a separate Patch for the corresponding 
Fate tests. Of course i'd still need someone to put my 2 testfiles to 
the fate-suite/mxf.
emcodem June 27, 2021, 9:40 p.m. UTC | #5
Am 2021-06-27 20:12, schrieb Marton Balint:
> Why? I though it is enough if you store the partition number in the
> metadata set, that way you should be able to compare if the existing
> metadata set is better than the current one when adding a new metadata
> set. Or am I missing something?

OK, i just had a try on this but honestly i don't know how this could 
work without a very deep change of the whole mxfdec.c.
The problem is that i cannot just add a field to the struct 
MXFMetadataSet as this points to raw data which has been read from the 
mxf file. I could add a field but if i initialize the value, i will 
automatically destroy the original raw data which was read from the mxf 
file.

In case i did not miss anything, i guess the 1-line change i sent is 
kind of best effort: it should not destroy any existing funtionality but 
in certain cases, it delivers more accurate metadata.

Lemme know your thoughts!
Marton Balint June 28, 2021, 1 a.m. UTC | #6
On Sun, 27 Jun 2021, emcodem@ffastrans.com wrote:

> Am 2021-06-27 20:12, schrieb Marton Balint:
>> Why? I though it is enough if you store the partition number in the
>> metadata set, that way you should be able to compare if the existing
>> metadata set is better than the current one when adding a new metadata
>> set. Or am I missing something?
>
> OK, i just had a try on this but honestly i don't know how this could work 
> without a very deep change of the whole mxfdec.c.
> The problem is that i cannot just add a field to the struct MXFMetadataSet as 
> this points to raw data which has been read from the mxf file. I could add a 
> field but if i initialize the value, i will automatically destroy the 
> original raw data which was read from the mxf file.

See the attached patch, that is what I had in mind. Or is it overkill? Can 
you test it with your dataset and see if it makes any difference?

Thanks,
Marton
emcodem June 28, 2021, 7:58 p.m. UTC | #7
Am 2021-06-28 03:00, schrieb Marton Balint:
> On Sun, 27 Jun 2021, emcodem@ffastrans.com wrote:
> 
>> Am 2021-06-27 20:12, schrieb Marton Balint:
>>> Why? I though it is enough if you store the partition number in the
>>> metadata set, that way you should be able to compare if the existing
>>> metadata set is better than the current one when adding a new 
>>> metadata
>>> set. Or am I missing something?
>> 
>> OK, i just had a try on this but honestly i don't know how this could 
>> work without a very deep change of the whole mxfdec.c.
>> The problem is that i cannot just add a field to the struct 
>> MXFMetadataSet as this points to raw data which has been read from the 
>> mxf file. I could add a field but if i initialize the value, i will 
>> automatically destroy the original raw data which was read from the 
>> mxf file.
> 
> See the attached patch, that is what I had in mind. Or is it overkill?
> Can you test it with your dataset and see if it makes any difference?
> 
> Thanks,
> Marton
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

Tested your patch pleasure, thanks for the support! The "score approach" 
seems to work in practice exactly as my previous patch, the only thing i 
fear about is that it is a little harder now to foresee which metadata 
source is taken from a users perspective but i also think it is now more 
compliant than it was before.

Using my test fileset which contains 4.476 mxf files (not all unique, 
maybe half is duplicates and most focus on xdcamhd and D10), we have 90 
differences between ffprobe before your patch and after your patch. All 
of the differences are only in files that have openincomplete header. 
Most of the differences just changes the duration from a guessed one to 
the analyzed one:

All STREAMS (NEW - OLD):
       "duration_ts": 3000,              "duration_ts": 3099,
       "duration": "120.000000",         "duration": "123.960000",
FORMAT      (NEW - OLD):
     "duration": "120.000000",           "duration": "123.969813",
     "bit_rate": "61178142",             "bit_rate": "59219070",

Exception one Op1b self contained file, where the "old" version did not 
spit out a "duration" value at all, so it was not even calculated from 
bitrate, it was just missing in the format section and set to 0 in the 
stream section.
Exception two, there were 4 files (3 were samples from IRT and 1 a real 
world file from old omneon version) where the startc OLD was 0 and the 
new one was the MP starttimecode from MP, so perfect.
So the conclusion is that of course your version had the same effect on 
my testfileset than my patch version, so thats nice.

Also, the FATE samples i shared will still work and can be used for this 
patch.
Attached a patch for adding only the fate samples. Note that these Fate 
tests of course fail when the patch for mxfdec.c is not applied.
https://we.tl/t-MVmyG2mZHq

Thanks a lot!
-emcodem
diff mbox series

Patch

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 7b40076fb4..a7f552c753 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1402,7 +1402,7 @@  static void *mxf_resolve_strong_ref(MXFContext *mxf, UID *strong_ref, enum MXFMe
 
     if (!strong_ref)
         return NULL;
-    for (i = 0; i < mxf->metadata_sets_count; i++) {
+    for (i = mxf->metadata_sets_count-1; i >= 0; i--) {
         if (!memcmp(*strong_ref, mxf->metadata_sets[i]->uid, 16) &&
             (type == AnyType || mxf->metadata_sets[i]->type == type)) {
             return mxf->metadata_sets[i];
diff --git a/tests/fate/mxf.mak b/tests/fate/mxf.mak
index 3a1096176f..1b7be46c64 100644
--- a/tests/fate/mxf.mak
+++ b/tests/fate/mxf.mak
@@ -37,6 +37,16 @@  FATE_MXF_PROBE-$(call ENCDEC2, PRORES, PCM_S24LE, MXF) += fate-mxf-probe-applehd
 fate-mxf-probe-applehdr10: SRC = $(TARGET_SAMPLES)/mxf/Meridian-Apple_ProResProxy-HDR10.mxf
 fate-mxf-probe-applehdr10: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)" | sed -e "s/yuv422p10../yuv422p10/"
 
+# openincomplete Header, truncated
+FATE_MXF_PROBE-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-probe-xdcamhd-oit
+fate-mxf-probe-xdcamhd-oit: SRC = $(TARGET_SAMPLES)/mxf/omneon_6.4.1.0.1_xdcam_truncated.mxf
+fate-mxf-probe-xdcamhd-oit: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
+
+# openincomplete Header, starttc in header 0 but Footer MP 10:11:17:21, SP 10:11:17:17
+FATE_MXF_PROBE-$(call ENCDEC2, MPEG2VIDEO, PCM_S24LE, MXF) += fate-mxf-probe-xdcamhd-tcfooter
+fate-mxf-probe-xdcamhd-tcfooter: SRC = $(TARGET_SAMPLES)/mxf/omneon_8.3.0.0_xdcam_startc_footer.mxf
+fate-mxf-probe-xdcamhd-tcfooter: CMD = run $(PROBE_FORMAT_STREAMS_COMMAND) -i "$(SRC)"
+
 FATE_MXF_REEL_NAME-$(call ENCDEC2, MPEG2VIDEO, PCM_S16LE, MXF) += fate-mxf-reel_name
 fate-mxf-reel_name: $(SAMPLES)/mxf/Sony-00001.mxf
 fate-mxf-reel_name: CMD = md5 -y -i $(TARGET_SAMPLES)/mxf/Sony-00001.mxf  -c copy -timecode 00:00:00:00 -metadata "reel_name=test_reel" -fflags +bitexact -f mxf
diff --git a/tests/ref/fate/mxf-probe-xdcamhd-oit b/tests/ref/fate/mxf-probe-xdcamhd-oit
new file mode 100644
index 0000000000..040a4e0fba
--- /dev/null
+++ b/tests/ref/fate/mxf-probe-xdcamhd-oit
@@ -0,0 +1,442 @@ 
+[STREAM]
+index=0
+codec_name=mpeg2video
+profile=0
+codec_type=video
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+width=1920
+height=1080
+coded_width=0
+coded_height=0
+closed_captions=0
+has_b_frames=1
+sample_aspect_ratio=1:1
+display_aspect_ratio=16:9
+pix_fmt=yuv422p
+level=2
+color_range=tv
+color_space=unknown
+color_transfer=bt709
+color_primaries=unknown
+chroma_location=topleft
+field_order=tt
+refs=1
+id=N/A
+r_frame_rate=25/1
+avg_frame_rate=25/1
+time_base=1/25
+start_pts=0
+start_time=0.000000
+duration_ts=6
+duration=0.240000
+bit_rate=50000000
+max_bit_rate=N/A
+bits_per_raw_sample=N/A
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[SIDE_DATA]
+side_data_type=CPB properties
+max_bitrate=50000000
+min_bitrate=0
+avg_bitrate=0
+buffer_size=12484608
+vbv_delay=-1
+[/SIDE_DATA]
+[/STREAM]
+[STREAM]
+index=1
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=11596
+duration=0.241583
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[/STREAM]
+[STREAM]
+index=2
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=11596
+duration=0.241583
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[/STREAM]
+[STREAM]
+index=3
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=11596
+duration=0.241583
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[/STREAM]
+[STREAM]
+index=4
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=11596
+duration=0.241583
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[/STREAM]
+[STREAM]
+index=5
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=11596
+duration=0.241583
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[/STREAM]
+[STREAM]
+index=6
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=11596
+duration=0.241583
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[/STREAM]
+[STREAM]
+index=7
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=11596
+duration=0.241583
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[/STREAM]
+[STREAM]
+index=8
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=11596
+duration=0.241583
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D2313003E792039C0579AD9E111BAFB00D028113D2C
+[/STREAM]
+[FORMAT]
+format_name=mxf
+duration=0.241583
+bit_rate=59674662
+TAG:operational_pattern_ul=060e2b34.04010101.0d010201.01010900
+TAG:uid=8033c057-9ad9-e111-aa7e-00d028113d2c
+TAG:generation_uid=9433c057-9ad9-e111-96cf-00d028113d2c
+TAG:company_name=Omneon Inc.
+TAG:product_name=Omneon Media Subsystem
+TAG:modification_date=2012-07-29T16:27:51.820000Z
+TAG:product_version=6.4.1.0.release
+TAG:product_version_num=6.4.1.0.1
+TAG:application_platform=Omneon Media Api (mqx)    
+TAG:product_uid=00000000-0000-0010-8000-050e0b010602
+TAG:material_package_umid=0x060A2B340101010501010D2313001BDF4438C0579AD9E1119C8800D028113D2C
+TAG:timecode=18:27:53:21
+[/FORMAT]
diff --git a/tests/ref/fate/mxf-probe-xdcamhd-tcfooter b/tests/ref/fate/mxf-probe-xdcamhd-tcfooter
new file mode 100644
index 0000000000..710cf616b5
--- /dev/null
+++ b/tests/ref/fate/mxf-probe-xdcamhd-tcfooter
@@ -0,0 +1,442 @@ 
+[STREAM]
+index=0
+codec_name=mpeg2video
+profile=0
+codec_type=video
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+width=1920
+height=1080
+coded_width=0
+coded_height=0
+closed_captions=0
+has_b_frames=1
+sample_aspect_ratio=1:1
+display_aspect_ratio=16:9
+pix_fmt=yuv422p
+level=2
+color_range=tv
+color_space=bt709
+color_transfer=bt709
+color_primaries=bt709
+chroma_location=topleft
+field_order=tt
+refs=1
+id=N/A
+r_frame_rate=25/1
+avg_frame_rate=25/1
+time_base=1/25
+start_pts=0
+start_time=0.000000
+duration_ts=13
+duration=0.520000
+bit_rate=50000000
+max_bit_rate=N/A
+bits_per_raw_sample=N/A
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[SIDE_DATA]
+side_data_type=CPB properties
+max_bitrate=50000000
+min_bitrate=0
+avg_bitrate=0
+buffer_size=17825792
+vbv_delay=-1
+[/SIDE_DATA]
+[/STREAM]
+[STREAM]
+index=1
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=24960
+duration=0.520000
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[/STREAM]
+[STREAM]
+index=2
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=24960
+duration=0.520000
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[/STREAM]
+[STREAM]
+index=3
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=24960
+duration=0.520000
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[/STREAM]
+[STREAM]
+index=4
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=24960
+duration=0.520000
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[/STREAM]
+[STREAM]
+index=5
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=24960
+duration=0.520000
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[/STREAM]
+[STREAM]
+index=6
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=24960
+duration=0.520000
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[/STREAM]
+[STREAM]
+index=7
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=24960
+duration=0.520000
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[/STREAM]
+[STREAM]
+index=8
+codec_name=pcm_s24le
+profile=unknown
+codec_type=audio
+codec_tag_string=[0][0][0][0]
+codec_tag=0x0000
+sample_fmt=s32
+sample_rate=48000
+channels=1
+channel_layout=unknown
+bits_per_sample=24
+id=N/A
+r_frame_rate=0/0
+avg_frame_rate=0/0
+time_base=1/48000
+start_pts=0
+start_time=0.000000
+duration_ts=24960
+duration=0.520000
+bit_rate=1152000
+max_bit_rate=N/A
+bits_per_raw_sample=24
+nb_frames=N/A
+nb_read_frames=N/A
+nb_read_packets=N/A
+DISPOSITION:default=0
+DISPOSITION:dub=0
+DISPOSITION:original=0
+DISPOSITION:comment=0
+DISPOSITION:lyrics=0
+DISPOSITION:karaoke=0
+DISPOSITION:forced=0
+DISPOSITION:hearing_impaired=0
+DISPOSITION:visual_impaired=0
+DISPOSITION:clean_effects=0
+DISPOSITION:attached_pic=0
+DISPOSITION:timed_thumbnails=0
+DISPOSITION:captions=0
+DISPOSITION:descriptions=0
+DISPOSITION:metadata=0
+DISPOSITION:dependent=0
+DISPOSITION:still_image=0
+TAG:file_package_umid=0x060A2B340101010501010D231300114B920EA7CA8BBF1B1EAC7100D028113D5C
+[/STREAM]
+[FORMAT]
+format_name=mxf
+duration=0.520000
+bit_rate=82212369
+TAG:operational_pattern_ul=060e2b34.04010101.0d010201.01010900
+TAG:application_platform=Omneon Media Api (mqx)    
+TAG:uid=6e0aa7ca-8bbf-1b1e-a5b4-00d028113d5c
+TAG:generation_uid=780aa7ca-8bbf-1b1e-93f8-00d028113d5c
+TAG:company_name=Omneon Inc.
+TAG:product_name=Omneon Media Subsystem
+TAG:modification_date=2021-05-28T08:07:48.620000Z
+TAG:product_version=8.3.0.0.release
+TAG:product_version_num=8.3.0.0.1
+TAG:product_uid=00000000-0000-1000-8000-050e0b010602
+TAG:material_package_umid=0x060A2B340101010501010D2313009472DE0DA7CA8BBF1B1EB07100D028113D5C
+TAG:timecode=10:11:17:21
+[/FORMAT]