[FFmpeg-user] Stream copy of mxf format is weird
Syehoon Kim
gregfeynman at gmail.com
Tue Jan 30 05:03:51 EET 2024
Dear all,
Sorry for having broken etiquette again...I am resending without the attachment.
I am trying to make a stream copy of a mxf file to a new one with
custom metadata.
But, I found that the new stream copied mxf file suffers from
non-monotonous dts problem.
What I found is that dts is duplicated every 3 frames.
I tried to use setpts bsf:v, but it didn't work.
The ffmpeg -vf showinfo message shows like belows:
[Parsed_showinfo_0 @ 000002967cb79c40] n: 1 pts: 2
pts_time:0.0667333 duration: 1 duration_time:0.0333667
fmt:yuv422p10le cl:left sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:4360C96A plane_checksum:[AC14C627 CC6DC0BD 71754277]
mean:[219 486 569] stdev:[209.8 27.8 31.7]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - SMPTE 12-1
timecode: timecode - 00:00:00:00
[Parsed_showinfo_0 @ 000002967cb79c40] color_range:tv
color_space:bt709 color_primaries:bt709 color_trc:bt709
[Parsed_showinfo_0 @ 000002967cb79c40] n: 2 pts: 0 pts_time:0
duration: 1 duration_time:0.0333667 fmt:yuv422p10le cl:left
sar:1/1 s:1920x1080 i:T iskey:1 type:I checksum:223C10C9
plane_checksum:[319CEFE3 D55DA81D 43B078AB] mean:[219 486 569]
stdev:[209.8 27.8 31.7]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - H.26[45] User
Data Unregistered SEI message:
UUID=a74602bb-f8a1-4cc0-a936-48e391dce761
[Parsed_showinfo_0 @ 000002967cb79c40] User Data=535249443011
[Parsed_showinfo_0 @ 000002967cb79c40]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - H.26[45] User
Data Unregistered SEI message:
UUID=dba1adef-b20c-40b4-8c85-8c0b46d5241e
[Parsed_showinfo_0 @ 000002967cb79c40] User Data=494d494401000000
[Parsed_showinfo_0 @ 000002967cb79c40]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - SMPTE 12-1
timecode: timecode - 00:00:00:00
[Parsed_showinfo_0 @ 000002967cb79c40] color_range:tv
color_space:bt709 color_primaries:bt709 color_trc:bt709
[null @ 000002967c208c00] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 2 >= 0
[Parsed_showinfo_0 @ 000002967cb79c40] n: 3 pts: 4
pts_time:0.133467 duration: 1 duration_time:0.0333667
fmt:yuv422p10le cl:left sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:621CB96F plane_checksum:[BFA555AE CFB30BDD 8B9157E4]
mean:[219 486 569] stdev:[209.7 27.8 31.6]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - SMPTE 12-1
timecode: timecode - 00:00:00:00
[Parsed_showinfo_0 @ 000002967cb79c40] color_range:tv
color_space:bt709 color_primaries:bt709 color_trc:bt709
[Parsed_showinfo_0 @ 000002967cb79c40] n: 4 pts: 5
pts_time:0.166833 duration: 1 duration_time:0.0333667
fmt:yuv422p10le cl:left sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:EA130FF7 plane_checksum:[071C6426 7FD85BF0 0A374FD2]
mean:[219 486 569] stdev:[209.7 27.7 31.6]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - SMPTE 12-1
timecode: timecode - 00:00:00:00
[Parsed_showinfo_0 @ 000002967cb79c40] color_range:tv
color_space:bt709 color_primaries:bt709 color_trc:bt709
[Parsed_showinfo_0 @ 000002967cb79c40] n: 5 pts: 3
pts_time:0.1001 duration: 1 duration_time:0.0333667
fmt:yuv422p10le cl:left sar:1/1 s:1920x1080 i:T iskey:0 type:P
checksum:ACEC2AC6 plane_checksum:[18186F28 23F23D94 F0DB7DFB]
mean:[219 486 569] stdev:[209.7 27.8 31.7]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - SMPTE 12-1
timecode: timecode - 00:00:00:00
[Parsed_showinfo_0 @ 000002967cb79c40] color_range:tv
color_space:bt709 color_primaries:bt709 color_trc:bt709
[null @ 000002967c208c00] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 5 >= 3
[Parsed_showinfo_0 @ 000002967cb79c40] n: 6 pts: 7
pts_time:0.233567 duration: 1 duration_time:0.0333667
fmt:yuv422p10le cl:left sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:AEC5E43A plane_checksum:[4DE4C8D9 F909E08C 67543AC6]
mean:[219 486 569] stdev:[209.7 27.7 31.6]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - SMPTE 12-1
timecode: timecode - 00:00:00:00
[Parsed_showinfo_0 @ 000002967cb79c40] color_range:tv
color_space:bt709 color_primaries:bt709 color_trc:bt709
[Parsed_showinfo_0 @ 000002967cb79c40] n: 7 pts: 8
pts_time:0.266933 duration: 1 duration_time:0.0333667
fmt:yuv422p10le cl:left sar:1/1 s:1920x1080 i:T iskey:0 type:B
checksum:8FAF60F1 plane_checksum:[CC499F8E 22A94FB8 3DCD719C]
mean:[219 486 569] stdev:[209.7 27.7 31.6]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - SMPTE 12-1
timecode: timecode - 00:00:00:00
[Parsed_showinfo_0 @ 000002967cb79c40] color_range:tv
color_space:bt709 color_primaries:bt709 color_trc:bt709
[Parsed_showinfo_0 @ 000002967cb79c40] n: 8 pts: 6
pts_time:0.2002 duration: 1 duration_time:0.0333667
fmt:yuv422p10le cl:left sar:1/1 s:1920x1080 i:T iskey:0 type:P
checksum:38971DE5 plane_checksum:[43CC9EB6 D6FC5C4C 78DA22D4]
mean:[219 486 569] stdev:[209.7 27.7 31.7]
[Parsed_showinfo_0 @ 000002967cb79c40] side data - SMPTE 12-1
timecode: timecode - 00:00:00:00
[Parsed_showinfo_0 @ 000002967cb79c40] color_range:tv
color_space:bt709 color_primaries:bt709 color_trc:bt709
[null @ 000002967c208c00] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 8 >= 6
and it goes with this pattern.
The ffprobe result is as follows:
[FRAME]
media_type=video
stream_index=0
key_frame=0
pts=1
pts_time=0.033367
pkt_dts=1
pkt_dts_time=0.033367
best_effort_timestamp=1
best_effort_timestamp_time=0.033367
pkt_duration=1
pkt_duration_time=0.033367
duration=1
duration_time=0.033367
pkt_pos=906240
pkt_size=82883
width=1920
height=1080
crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
pix_fmt=yuv422p10le
sample_aspect_ratio=1:1
pict_type=B
coded_picture_number=1
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=tv
color_space=bt709
color_primaries=bt709
color_transfer=bt709
chroma_location=left
TAG:timecode=00:00:00:00
[SIDE_DATA]
side_data_type=SMPTE 12-1 timecode
[TIMECODE]
value=00:00:00:00
[/TIMECODE]
[/SIDE_DATA]
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pts=2
pts_time=0.066733
pkt_dts=2
pkt_dts_time=0.066733
best_effort_timestamp=2
best_effort_timestamp_time=0.066733
pkt_duration=1
pkt_duration_time=0.033367
duration=1
duration_time=0.033367
pkt_pos=994816
pkt_size=85453
width=1920
height=1080
crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
pix_fmt=yuv422p10le
sample_aspect_ratio=1:1
pict_type=B
coded_picture_number=2
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=tv
color_space=bt709
color_primaries=bt709
color_transfer=bt709
chroma_location=left
TAG:timecode=00:00:00:00
[SIDE_DATA]
side_data_type=SMPTE 12-1 timecode
[TIMECODE]
value=00:00:00:00
[/TIMECODE]
[/SIDE_DATA]
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=1
pts=0
pts_time=0.000000
pkt_dts=2
pkt_dts_time=0.066733
best_effort_timestamp=0
best_effort_timestamp_time=0.000000
pkt_duration=1
pkt_duration_time=0.033367
duration=1
duration_time=0.033367
pkt_pos=7168
pkt_size=893392
width=1920
height=1080
crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
pix_fmt=yuv422p10le
sample_aspect_ratio=1:1
pict_type=I
coded_picture_number=0
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=tv
color_space=bt709
color_primaries=bt709
color_transfer=bt709
chroma_location=left
TAG:timecode=00:00:00:00
[SIDE_DATA]
side_data_type=H.26[45] User Data Unregistered SEI message
[/SIDE_DATA]
[SIDE_DATA]
side_data_type=H.26[45] User Data Unregistered SEI message
[/SIDE_DATA]
[SIDE_DATA]
side_data_type=SMPTE 12-1 timecode
[TIMECODE]
value=00:00:00:00
[/TIMECODE]
[/SIDE_DATA]
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pts=4
pts_time=0.133467
pkt_dts=4
pkt_dts_time=0.133467
best_effort_timestamp=4
best_effort_timestamp_time=0.133467
pkt_duration=1
pkt_duration_time=0.033367
duration=1
duration_time=0.033367
pkt_pos=1387008
pkt_size=78518
width=1920
height=1080
crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
pix_fmt=yuv422p10le
sample_aspect_ratio=1:1
pict_type=B
coded_picture_number=4
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=tv
color_space=bt709
color_primaries=bt709
color_transfer=bt709
chroma_location=left
TAG:timecode=00:00:00:00
[SIDE_DATA]
side_data_type=SMPTE 12-1 timecode
[TIMECODE]
value=00:00:00:00
[/TIMECODE]
[/SIDE_DATA]
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pts=5
pts_time=0.166833
pkt_dts=5
pkt_dts_time=0.166833
best_effort_timestamp=5
best_effort_timestamp_time=0.166833
pkt_duration=1
pkt_duration_time=0.033367
duration=1
duration_time=0.033367
pkt_pos=1471488
pkt_size=77660
width=1920
height=1080
crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
pix_fmt=yuv422p10le
sample_aspect_ratio=1:1
pict_type=B
coded_picture_number=5
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=tv
color_space=bt709
color_primaries=bt709
color_transfer=bt709
chroma_location=left
TAG:timecode=00:00:00:00
[SIDE_DATA]
side_data_type=SMPTE 12-1 timecode
[TIMECODE]
value=00:00:00:00
[/TIMECODE]
[/SIDE_DATA]
[/FRAME]
[FRAME]
media_type=video
stream_index=0
key_frame=0
pts=3
pts_time=0.100100
pkt_dts=5
pkt_dts_time=0.166833
best_effort_timestamp=3
best_effort_timestamp_time=0.100100
pkt_duration=1
pkt_duration_time=0.033367
duration=1
duration_time=0.033367
pkt_pos=1085952
pkt_size=295239
width=1920
height=1080
crop_top=0
crop_bottom=0
crop_left=0
crop_right=0
pix_fmt=yuv422p10le
sample_aspect_ratio=1:1
pict_type=P
coded_picture_number=3
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
color_range=tv
color_space=bt709
color_primaries=bt709
color_transfer=bt709
chroma_location=left
TAG:timecode=00:00:00:00
[SIDE_DATA]
side_data_type=SMPTE 12-1 timecode
[TIMECODE]
value=00:00:00:00
[/TIMECODE]
[/SIDE_DATA]
[/FRAME]
The command I used is as follows:
ffmpeg -i (original_mxf).mxf -codec copy (stream_copied).mxf
Interestingly, if I convert the weird mxf output file to another
format such as mov, or avi, it works well.
Of course, I used the latest ffmpeg.
Should I report this as a bug?
If you have any idea, I would appreciate it.
Thank you.
Sincerely,
Kim Syehoon
More information about the ffmpeg-user
mailing list