[FFmpeg-user] Question about concat protocol

Jan Ehrhardt phpdev at ehrhardt.nl
Mon Oct 29 14:38:24 CET 2012


Nicolas George in gmane.comp.video.ffmpeg.user (Sun, 28 Oct 2012
09:41:11 +0100):
>The problem is visible here, and fortunately it is the easiest one: in the
>second file, the audio and video do not start at exactly the same time.
>Therefore, the STARTPTS value that you subtract to both is not the same,
>thus causing the desync: 1210.366744-1210.161144=0.2056 is very visible.

The same might be the problem with Sean Darcy's Canon MTS-files in
'joining avchd files'. I have similar files in which the second one
starts with 9 audio frames and then comes the first video frame. At the
end of the first file there are about 3-4 videoframes without the
corresponding audio.

Audio STARTPTS: 2943.708000
Video STARTPTS: 2943.820000

A desync of 0.112 would be the result. It is hard for me to confirm this
because there are no scenes to test the 'out-of-lipsync'.

A fysical cat of the files is no option for me, because I cannot use HD
space and are limited by the space on the SD card where the video files
reside. If this proves to be a real problem. I will have to go back to
my previous solution: transcode the segments one by one and stitch them
together afterwards by using asfbin (WMV), flvbind (FLV) or MP4Box
(MP4).

BTW: with my testfiles I did a fysical cat (or copy /b on Windows).
Neither ffmpeg nor ffprobe showed any errors anymore, while they
complained about incomplete frames in the filter_complex setup.

I have to try yet if the concat-protocol works on these files.

Jan


Start of second file:

[FRAME]
media_type=audio
key_frame=1
pkt_pts=264933720
pkt_pts_time=2943.708000
pkt_dts=264933720
pkt_dts_time=2943.708000
pkt_pos=16132
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264936600
pkt_pts_time=2943.740000
pkt_dts=264936600
pkt_dts_time=2943.740000
pkt_pos=72004
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264939480
pkt_pts_time=2943.772000
pkt_dts=264939480
pkt_dts_time=2943.772000
pkt_pos=128068
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264942360
pkt_pts_time=2943.804000
pkt_dts=264942360
pkt_dts_time=2943.804000
pkt_pos=172804
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264945240
pkt_pts_time=2943.836000
pkt_dts=264945240
pkt_dts_time=2943.836000
pkt_pos=206980
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264948120
pkt_pts_time=2943.868000
pkt_dts=264948120
pkt_dts_time=2943.868000
pkt_pos=224452
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264951000
pkt_pts_time=2943.900000
pkt_dts=264951000
pkt_dts_time=2943.900000
pkt_pos=226756
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264953880
pkt_pts_time=2943.932000
pkt_dts=264953880
pkt_dts_time=2943.932000
pkt_pos=229060
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264956760
pkt_pts_time=2943.964000
pkt_dts=264956760
pkt_dts_time=2943.964000
pkt_pos=265348
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=video
key_frame=0
pkt_pts=264943800
pkt_pts_time=2943.820000
pkt_dts=264945600
pkt_dts_time=2943.840000
pkt_pos=964
width=1440
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=4:3
pict_type=P
coded_picture_number=0
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
reference=3
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264959640
pkt_pts_time=2943.996000
pkt_dts=264959640
pkt_dts_time=2943.996000
pkt_pos=269572
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=video
key_frame=0
pkt_pts=264947400
pkt_pts_time=2943.860000
pkt_dts=264949200
pkt_dts_time=2943.880000
pkt_pos=220612
width=1440
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=4:3
pict_type=B
coded_picture_number=4
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
reference=0
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264962520
pkt_pts_time=2944.028000
pkt_dts=264962520
pkt_dts_time=2944.028000
pkt_pos=274948
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=video
key_frame=0
pkt_pts=264951000
pkt_pts_time=2943.900000
pkt_dts=264952800
pkt_dts_time=2943.920000
pkt_pos=225604
width=1440
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=4:3
pict_type=B
coded_picture_number=5
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
reference=0
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264965400
pkt_pts_time=2944.060000
pkt_dts=264965400
pkt_dts_time=2944.060000
pkt_pos=277444
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=video
key_frame=0
pkt_pts=264954600
pkt_pts_time=2943.940000
pkt_dts=264956400
pkt_dts_time=2943.960000
pkt_pos=177988
width=1440
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=4:3
pict_type=P
coded_picture_number=3
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
reference=3
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264968280
pkt_pts_time=2944.092000
pkt_dts=264968280
pkt_dts_time=2944.092000
pkt_pos=319108
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264971160
pkt_pts_time=2944.124000
pkt_dts=264971160
pkt_dts_time=2944.124000
pkt_pos=326020
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=video
key_frame=0
pkt_pts=264958200
pkt_pts_time=2943.980000
pkt_dts=264960000
pkt_dts_time=2944.000000
pkt_pos=266500
width=1440
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=4:3
pict_type=B
coded_picture_number=7
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
reference=0
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264974040
pkt_pts_time=2944.156000
pkt_dts=264974040
pkt_dts_time=2944.156000
pkt_pos=332356
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=video
key_frame=0
pkt_pts=264961800
pkt_pts_time=2944.020000
pkt_dts=264963600
pkt_dts_time=2944.040000
pkt_pos=271108
width=1440
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=4:3
pict_type=B
coded_picture_number=8
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
reference=0
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264976920
pkt_pts_time=2944.188000
pkt_dts=264976920
pkt_dts_time=2944.188000
pkt_pos=348676
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264979800
pkt_pts_time=2944.220000
pkt_dts=264979800
pkt_dts_time=2944.220000
pkt_pos=404740
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264982680
pkt_pts_time=2944.252000
pkt_dts=264982680
pkt_dts_time=2944.252000
pkt_pos=460420
sample_fmt=s16
nb_samples=1536
[/FRAME]
[FRAME]
media_type=video
key_frame=0
pkt_pts=264965400
pkt_pts_time=2944.060000
pkt_dts=264967200
pkt_dts_time=2944.080000
pkt_pos=230020
width=1440
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=4:3
pict_type=P
coded_picture_number=6
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
reference=3
[/FRAME]
[FRAME]
media_type=video
key_frame=0
pkt_pts=264969000
pkt_pts_time=2944.100000
pkt_dts=264970800
pkt_dts_time=2944.120000
pkt_pos=320452
width=1440
height=1080
pix_fmt=yuv420p
sample_aspect_ratio=4:3
pict_type=B
coded_picture_number=10
display_picture_number=0
interlaced_frame=1
top_field_first=1
repeat_pict=0
reference=0
[/FRAME]
[FRAME]
media_type=audio
key_frame=1
pkt_pts=264985560
pkt_pts_time=2944.284000
pkt_dts=264985560
pkt_dts_time=2944.284000
pkt_pos=507652
sample_fmt=s16
nb_samples=1536
[/FRAME]



More information about the ffmpeg-user mailing list