[FFmpeg-trac] #2478(undetermined:new): PTS: DTS: invalid, clipping with pcm audio codec
FFmpeg
trac at avcodec.org
Thu Apr 18 12:55:57 CEST 2013
#2478: PTS: DTS: invalid, clipping with pcm audio codec
-------------------------------------+-------------------------------------
Reporter: MrNice | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug: I am trying to capture S-VHS with a Dazzle DVC100
device.
I run a build without v4l2.
I capture 1 mn with a synchro A/V film. With VLC I get a good sync in
direct play.
I get the following error when recording with ffmpeg:
{{{$ ffmpeg -debug 1 -f alsa -ac 2 -channel_layout stereo -i hw:0,0 -f
v4l2 -channel 1 -input_format yuyv422 -i /dev/video0 -map 0:a -map 1:v
-c:a pcm_s16le -c:v ffv1 /Store3/Test/pcm_ffv1_`date +%m%d_%H%M`.avi
ffmpeg version N-52061-g8137ea3 Copyright (c) 2000-2013 the FFmpeg
developers
built on Apr 13 2013 21:10:51 with gcc 4.4.7 (GCC) 20120313 (Red Hat
4.4.7-3)
configuration: --prefix=/opt/ffmpeg-opt/usr --enable-shared
--bindir=/opt/ffmpeg-opt/usr/bin --datadir=/opt/ffmpeg-opt/usr/share
/ffmpeg-opt --incdir=/opt/ffmpeg-opt/usr/include/ffmpeg-opt --libdir=/opt
/ffmpeg-opt/usr/lib64 --mandir=/opt/ffmpeg-opt/usr/share/man
--shlibdir=/opt/ffmpeg-opt/usr/lib64 --arch=x86_64 --optflags='-O2 -g'
--enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass
--enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-
libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-
libopus --enable-libpulse --enable-libschroedinger --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libx264 --disable-libv4l2
--enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc
--enable-pthreads --disable-static --enable-shared --enable-gpl --disable-
debug --disable-stripping --build-suffix=1 --disable-doc --enable-runtime-
cpudetect
libavutil 52. 26.100 / 52. 26.100
libavcodec 55. 2.100 / 55. 2.100
libavformat 55. 2.100 / 55. 2.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 53.101 / 3. 53.101
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
matched as AVOption 'debug' with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'alsa'.
Reading option '-ac' ... matched as option 'ac' (set number of audio
channels) with argument '2'.
Reading option '-channel_layout' ... matched as option 'channel_layout'
(set channel layout) with argument 'stereo'.
Reading option '-i' ... matched as input file with argument 'hw:0,0'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'v4l2'.
Reading option '-channel' ... matched as AVOption 'channel' with argument
'1'.
Reading option '-input_format' ... matched as AVOption 'input_format' with
argument 'yuyv422'.
Reading option '-i' ... matched as input file with argument '/dev/video0'.
Reading option '-map' ... matched as option 'map' (set input stream
mapping) with argument '0:a'.
Reading option '-map' ... matched as option 'map' (set input stream
mapping) with argument '1:v'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument
'pcm_s16le'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument
'ffv1'.
Reading option '/Store3/Test/pcm_ffv1_0418_1024.avi' ... matched as output
file.
Finished splitting the commandline.
Parsing a group of options: global .
Successfully parsed a group of options.
Parsing a group of options: input file hw:0,0.
Applying option f (force format) with argument alsa.
Applying option ac (set number of audio channels) with argument 2.
Applying option channel_layout (set channel layout) with argument stereo.
Successfully parsed a group of options.
Opening an input file: hw:0,0.
[alsa @ 0x22f5220] All info found
Input #0, alsa, from 'hw:0,0':
Duration: N/A, start: 1366277089.951533, bitrate: 1536 kb/s
Stream #0:0, 1, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, s16,
1536 kb/s
Successfully opened the file.
Parsing a group of options: input file /dev/video0.
Applying option f (force format) with argument v4l2.
Successfully parsed a group of options.
Opening an input file: /dev/video0.
[video4linux2,v4l2 @ 0x2316ec0] fd:4 capabilities:5020041
[video4linux2,v4l2 @ 0x2316ec0] Selecting input_channel: 1
[video4linux2,v4l2 @ 0x2316ec0] Current input_channel: 1, input_name:
S-Video
[video4linux2,v4l2 @ 0x2316ec0] Querying the device for the current frame
size
[video4linux2,v4l2 @ 0x2316ec0] Setting frame size to 720x576
[video4linux2,v4l2 @ 0x2316ec0] The V4L2 driver is using the interlaced
mode
[video4linux2,v4l2 @ 0x2316ec0] Current standard: PAL, id: 255,
frameperiod: 1/25
[video4linux2,v4l2 @ 0x2316ec0] All info found
Input #1, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 1366277090.571670, bitrate: 165888 kb/s
Stream #1:0, 1, 1/1000000: Video: rawvideo (YUY2 / 0x32595559),
yuyv422, 720x576, 1/1000000, 165888 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k
tbc
Successfully opened the file.
Parsing a group of options: output file
/Store3/Test/pcm_ffv1_0418_1024.avi.
Applying option map (set input stream mapping) with argument 0:a.
Applying option map (set input stream mapping) with argument 1:v.
Applying option c:a (codec name) with argument pcm_s16le.
Applying option c:v (codec name) with argument ffv1.
Successfully parsed a group of options.
Opening an output file: /Store3/Test/pcm_ffv1_0418_1024.avi.
Successfully opened the file.
[graph 0 input from stream 0:0 @ 0x22f4c40] Setting 'time_base' to value
'1/48000'
[graph 0 input from stream 0:0 @ 0x22f4c40] Setting 'sample_rate' to value
'48000'
[graph 0 input from stream 0:0 @ 0x22f4c40] Setting 'sample_fmt' to value
's16'
[graph 0 input from stream 0:0 @ 0x22f4c40] Setting 'channel_layout' to
value '0x3'
[graph 0 input from stream 0:0 @ 0x22f4c40] tb:1/48000 samplefmt:s16
samplerate:48000 chlayout:0x3
[audio format for output stream 0:0 @ 0x22fc8e0] Setting 'sample_fmts' to
value 's16'
[AVFilterGraph @ 0x2317f40] query_formats: 4 queried, 9 merged, 0 already
done, 0 delayed
[graph 1 input from stream 1:0 @ 0x22fe600] Setting 'video_size' to value
'720x576'
[graph 1 input from stream 1:0 @ 0x22fe600] Setting 'pix_fmt' to value '1'
[graph 1 input from stream 1:0 @ 0x22fe600] Setting 'time_base' to value
'1/1000000'
[graph 1 input from stream 1:0 @ 0x22fe600] Setting 'pixel_aspect' to
value '0/1'
[graph 1 input from stream 1:0 @ 0x22fe600] Setting 'sws_param' to value
'flags=2'
[graph 1 input from stream 1:0 @ 0x22fe600] Setting 'frame_rate' to value
'25/1'
[graph 1 input from stream 1:0 @ 0x22fe600] w:720 h:576 pixfmt:yuyv422
tb:1/1000000 fr:25/1 sar:0/1 sws_param:flags=2
[format @ 0x22ff480] compat: called with
args=[yuv420p|yuva420p|yuva422p|yuv444p|yuva444p|yuv440p|yuv422p|yuv411p|yuv410p|bgr0|bgra|yuv420p16le|yuv422p16le|yuv444p16le|yuv444p9le|yuv422p9le|yuv420p9le|yuv420p10le|yuv422p10le|yuv444p10le|gray16le|gray|gbrp9le|gbrp10le|gbrp12le|gbrp14le]
[format @ 0x22ff480] Setting 'pix_fmts' to value
'yuv420p|yuva420p|yuva422p|yuv444p|yuva444p|yuv440p|yuv422p|yuv411p|yuv410p|bgr0|bgra|yuv420p16le|yuv422p16le|yuv444p16le|yuv444p9le|yuv422p9le|yuv420p9le|yuv420p10le|yuv422p10le|yuv444p10le|gray16le|gray|gbrp9le|gbrp10le|gbrp12le|gbrp14le'
[auto-inserted scaler 0 @ 0x22ff2a0] Setting 'w' to value '0'
[auto-inserted scaler 0 @ 0x22ff2a0] Setting 'h' to value '0'
[auto-inserted scaler 0 @ 0x22ff2a0] Setting 'flags' to value '0x4'
[auto-inserted scaler 0 @ 0x22ff2a0] w:0 h:0 flags:'0x4' interl:0
[format @ 0x22ff480] auto-inserting filter 'auto-inserted scaler 0'
between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x22fe460] query_formats: 4 queried, 3 merged, 1 already
done, 0 delayed
[auto-inserted scaler 0 @ 0x22ff2a0] picking yuv422p out of 26 ref:yuyv422
alpha:0
[auto-inserted scaler 0 @ 0x22ff2a0] w:720 h:576 fmt:yuyv422 sar:0/1 ->
w:720 h:576 fmt:yuv422p sar:0/1 flags:0x4
[ffv1 @ 0x2319260] detected 8 logical cores
Output #0, avi, to '/Store3/Test/pcm_ffv1_0418_1024.avi':
Metadata:
ISFT : Lavf55.2.100
Stream #0:0, 0, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001),
48000 Hz, stereo, s16, 1536 kb/s
Stream #0:1, 0, 1/25: Video: ffv1 (FFV1 / 0x31564646), yuv422p,
720x576, 1/25, q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
Stream #1:0 -> #0:1 (rawvideo -> ffv1)
Press [q] to stop, [?] for help
st:0 PTS: 1278403 DTS: 1278403 < 1278404 invalid, clipping
bitrate=31462.5kbits/s
st:0 PTS: 1298738 DTS: 1298738 < 1298739 invalid, clipping
bitrate=31479.7kbits/s
[avi @ 0x23181c0] st:0 PTS: 1298827 DTS: 1298827 < 1298828 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 1298828 DTS: 1298828 < 1298829 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 1298829 DTS: 1298829 < 1298830 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 1298830 DTS: 1298830 < 1298831 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 1298831 DTS: 1298831 < 1298832 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 1298832 DTS: 1298832 < 1298833 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 1298833 DTS: 1298833 < 1298834 invalid,
clipping
st:0 PTS: 1325059 DTS: 1325059 < 1325060 invalid, clipping
bitrate=31472.5kbits/s
st:0 PTS: 1346723 DTS: 1346723 < 1346724 invalid, clipping
bitrate=31507.5kbits/s
st:0 PTS: 1399222 DTS: 1399222 < 1399223 invalid, clipping
bitrate=31526.6kbits/s
[avi @ 0x23181c0] st:0 PTS: 1399713 DTS: 1399713 < 1399714 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 1399714 DTS: 1399714 < 1399715 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 1409742 DTS: 1409742 < 1409743 invalid,
clipping
....[cut]....
[avi @ 0x23181c0] st:0 PTS: 2735025 DTS: 2735025 < 2735026 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 2735026 DTS: 2735026 < 2735027 invalid,
clipping
st:0 PTS: 2738455 DTS: 2738455 < 2738456 invalid, clipping
bitrate=31798.0kbits/s
[avi @ 0x23181c0] st:0 PTS: 2746286 DTS: 2746286 < 2746287 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 2750202 DTS: 2750202 < 2750203 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 2752656 DTS: 2752656 < 2752657 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 2757558 DTS: 2757558 < 2757559 invalid,
clipping
st:0 PTS: 2759610 DTS: 2759610 < 2759611 invalid, clipping
bitrate=31821.6kbits/s
[avi @ 0x23181c0] st:0 PTS: 2761571 DTS: 2761571 < 2761572 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 2771378 DTS: 2771378 < 2771379 invalid,
clipping
st:0 PTS: 2787546 DTS: 2787546 < 2787547 invalid, clipping
bitrate=31802.0kbits/s
[avi @ 0x23181c0] st:0 PTS: 2795875 DTS: 2795875 < 2795876 invalid,
clipping
[avi @ 0x23181c0] st:0 PTS: 2805205 DTS: 2805205 < 2805206 invalid,
clipping
st:0 PTS: 2833986 DTS: 2833986 < 2833987 invalid, clipping
bitrate=31830.9kbits/s
[avi @ 0x23181c0] st:0 PTS: 2835452 DTS: 2835452 < 2835453 invalid,
clipping
frame= 1507 fps= 25 q=0.0 Lsize= 236861kB time=00:01:00.85
bitrate=31887.0kbits/s
video:225091kB audio:11410kB subtitle:0 global headers:0kB muxing overhead
0.152210%
14915 frames successfully decoded, 0 decoding errors
Statistics: 10 seeks, 20959 writeouts
}}}
But there is a desync, audio is late by around 0.5s (0.5s at the beginning
and still 0.5s after 1mn).
I did more tests with the following:
Audio codec Video codec Container Result
pcm_s16le ffv1 avi invalid, clipping / desync
flac ffv1 avi No error / desync
ac3 ffv1 avi No error / desync
mp3 ffv1 avi No error / desync
mp2 ffv1 avi No error / desync
pcm_s16le huffyuv avi invalid, clipping / desync
flac huffyuv avi No error / desync
ac3 huffyuv avi No error / desync
mp3 huffyuv avi No error / desync
mp2 huffyuv avi No error / desync
pcm_s16le ffv1 mkv No error / desync
flac ffv1 mkv No error / desync
ac3 ffv1 mkv No error / desync
mp3 ffv1 mkv No error / desync
mp2 ffv1 mkv No error / desync
pcm_s16le huffyuv mkv No error / desync
flac huffyuv mkv No error / desync
ac3 huffyuv mkv No error / desync
mp3 huffyuv mkv No error / desync
mp2 huffyuv mkv No error / desync
Seems that the desync is not related to the invalid, clipping.
If you need more info or tests don't hesitate to ask me.
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2478>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list