[FFmpeg-trac] #2478(avdevice:new): PTS: DTS: invalid, clipping when recording alsa

FFmpeg trac at avcodec.org
Wed Jun 12 19:51:05 CEST 2013


#2478: PTS: DTS: invalid, clipping when recording alsa
------------------------------------+------------------------------------
             Reporter:  MrNice      |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avdevice
              Version:  git-master  |               Resolution:
             Keywords:  alsa        |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+------------------------------------

Comment (by MrNice):

 I removed the line 193.
 1st test, same command than comment 7
 {{{
 ./ffmpeg -debug 1 -vn -f alsa -ac 2 -channel_layout stereo -i hw:0,0 -c:a
 pcm_s16le out.wav
 ffmpeg version N-53955-gd3e89f2 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Jun 11 2013 15:29:15 with gcc 4.4.7 (GCC) 20120313 (Red Hat
 4.4.7-3)
   configuration:
   libavutil      52. 35.100 / 52. 35.100
   libavcodec     55. 15.100 / 55. 15.100
   libavformat    55.  8.102 / 55.  8.102
   libavdevice    55.  2.100 / 55.  2.100
   libavfilter     3. 75.101 /  3. 75.101
   libswscale      2.  3.100 /  2.  3.100
   libswresample   0. 17.102 /  0. 17.102
  matched as AVOption 'debug' with argument '1'.
 Reading option '-vn' ... matched as option 'vn' (disable video) 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 '-c:a' ... matched as option 'c' (codec name) with argument
 'pcm_s16le'.
 Reading option 'out.wav' ... 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 vn (disable video) with argument 1.
 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 @ 0x1ec7d00] All info found
 Input #0, alsa, from 'hw:0,0':
   Duration: N/A, start: 1371058668.112454, 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: output file out.wav.
 Applying option c:a (codec name) with argument pcm_s16le.
 Successfully parsed a group of options.
 Opening an output file: out.wav.
 File 'out.wav' already exists. Overwrite ? [y/N] y
 Successfully opened the file.
 detected 8 logical cores
 [graph 0 input from stream 0:0 @ 0x1ec1300] Setting 'time_base' to value
 '1/48000'
 [graph 0 input from stream 0:0 @ 0x1ec1300] Setting 'sample_rate' to value
 '48000'
 [graph 0 input from stream 0:0 @ 0x1ec1300] Setting 'sample_fmt' to value
 's16'
 [graph 0 input from stream 0:0 @ 0x1ec1300] Setting 'channel_layout' to
 value '0x3'
 [graph 0 input from stream 0:0 @ 0x1ec1300] tb:1/48000 samplefmt:s16
 samplerate:48000 chlayout:0x3
 [audio format for output stream 0:0 @ 0x1ec17c0] Setting 'sample_fmts' to
 value 's16'
 [AVFilterGraph @ 0x1ec78c0] query_formats: 4 queried, 9 merged, 0 already
 done, 0 delayed
 Output #0, wav, to 'out.wav':
   Metadata:
     ISFT            : Lavf55.8.102
     Stream #0:0, 0, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001),
 48000 Hz, stereo, s16, 1536 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
 Press [q] to stop, [?] for help
 [alsa @ 0x1ec7d00] ALSA buffer xrun.
 size=    2520kB time=00:00:16.37 bitrate=1260.8kbits/s
 video:0kB audio:2520kB subtitle:0 global headers:0kB muxing overhead
 0.003100%
 315 frames successfully decoded, 0 decoding errors
 [AVIOContext @ 0x1ee3be0] Statistics: 4 seeks, 318 writeouts
 }}}
 Sound has what I call "tics" after some "bips"

 2nd test, same command than comment 6

 {{{
 $ ./ffmpeg -debug 1 -f v4l2 -channel 1 -input_format yuyv422 -i
 /dev/video0 -f alsa -ac 2 -channel_layout stereo -i hw:0,0 -map 0:v -map
 1:a -c:a pcm_s16le -c:v ffv1 out.avi
 ffmpeg version N-53955-gd3e89f2 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Jun 11 2013 15:29:15 with gcc 4.4.7 (GCC) 20120313 (Red Hat
 4.4.7-3)
   configuration:
   libavutil      52. 35.100 / 52. 35.100
   libavcodec     55. 15.100 / 55. 15.100
   libavformat    55.  8.102 / 55.  8.102
   libavdevice    55.  2.100 / 55.  2.100
   libavfilter     3. 75.101 /  3. 75.101
   libswscale      2.  3.100 /  2.  3.100
   libswresample   0. 17.102 /  0. 17.102
  matched as AVOption 'debug' with argument '1'.
 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 '-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 '-map' ... matched as option 'map' (set input stream
 mapping) with argument '0:v'.
 Reading option '-map' ... matched as option 'map' (set input stream
 mapping) with argument '1:a'.
 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 'out.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 /dev/video0.
 Applying option f (force format) with argument v4l2.
 Successfully parsed a group of options.
 Opening an input file: /dev/video0.
 [video4linux2,v4l2 @ 0x18c2420] fd:3 capabilities:5020041
 [video4linux2,v4l2 @ 0x18c2420] Selecting input_channel: 1
 [video4linux2,v4l2 @ 0x18c2420] Current input_channel: 1, input_name:
 S-Video
 [video4linux2,v4l2 @ 0x18c2420] Querying the device for the current frame
 size
 [video4linux2,v4l2 @ 0x18c2420] Setting frame size to 720x576
 [video4linux2,v4l2 @ 0x18c2420] The V4L2 driver is using the interlaced
 mode
 [video4linux2,v4l2 @ 0x18c2420] Current standard: PAL, id: 255,
 frameperiod: 1/25
 [video4linux2,v4l2 @ 0x18c2420] All info found
 Input #0, video4linux2,v4l2, from '/dev/video0':
   Duration: N/A, start: 1371059054.306878, bitrate: 165888 kb/s
     Stream #0: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: 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 @ 0x18c4100] All info found
 Input #1, alsa, from 'hw:0,0':
   Duration: N/A, start: 1371059054.309044, bitrate: 1536 kb/s
     Stream #1:0, 1, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, s16,
 1536 kb/s
 Successfully opened the file.
 Parsing a group of options: output file out.avi.
 Applying option map (set input stream mapping) with argument 0:v.
 Applying option map (set input stream mapping) with argument 1:a.
 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: out.avi.
 File 'out.avi' already exists. Overwrite ? [y/N] y
 Successfully opened the file.
 detected 8 logical cores
 [graph 0 input from stream 0:0 @ 0x18a5280] Setting 'video_size' to value
 '720x576'
 [graph 0 input from stream 0:0 @ 0x18a5280] Setting 'pix_fmt' to value '1'
 [graph 0 input from stream 0:0 @ 0x18a5280] Setting 'time_base' to value
 '1/1000000'
 [graph 0 input from stream 0:0 @ 0x18a5280] Setting 'pixel_aspect' to
 value '0/1'
 [graph 0 input from stream 0:0 @ 0x18a5280] Setting 'sws_param' to value
 'flags=2'
 [graph 0 input from stream 0:0 @ 0x18a5280] Setting 'frame_rate' to value
 '25/1'
 [graph 0 input from stream 0:0 @ 0x18a5280] w:720 h:576 pixfmt:yuyv422
 tb:1/1000000 fr:25/1 sar:0/1 sws_param:flags=2
 [format @ 0x18a6880] 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 @ 0x18a6880] 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 @ 0x18a5fe0] Setting 'flags' to value '0x4'
 [auto-inserted scaler 0 @ 0x18a5fe0] w:iw h:ih flags:'0x4' interl:0
 [format @ 0x18a6880] auto-inserting filter 'auto-inserted scaler 0'
 between the filter 'Parsed_null_0' and the filter 'format'
 [AVFilterGraph @ 0x18ab7e0] query_formats: 4 queried, 3 merged, 1 already
 done, 0 delayed
 [auto-inserted scaler 0 @ 0x18a5fe0] picking yuv422p out of 26 ref:yuyv422
 alpha:0
 [auto-inserted scaler 0 @ 0x18a5fe0] w:720 h:576 fmt:yuyv422 sar:0/1 ->
 w:720 h:576 fmt:yuv422p sar:0/1 flags:0x4
 [graph 1 input from stream 1:0 @ 0x18a9dc0] Setting 'time_base' to value
 '1/48000'
 [graph 1 input from stream 1:0 @ 0x18a9dc0] Setting 'sample_rate' to value
 '48000'
 [graph 1 input from stream 1:0 @ 0x18a9dc0] Setting 'sample_fmt' to value
 's16'
 [graph 1 input from stream 1:0 @ 0x18a9dc0] Setting 'channel_layout' to
 value '0x3'
 [graph 1 input from stream 1:0 @ 0x18a9dc0] tb:1/48000 samplefmt:s16
 samplerate:48000 chlayout:0x3
 [audio format for output stream 0:1 @ 0x18aa380] Setting 'sample_fmts' to
 value 's16'
 [AVFilterGraph @ 0x18abb60] query_formats: 4 queried, 9 merged, 0 already
 done, 0 delayed
 Output #0, avi, to 'out.avi':
   Metadata:
     ISFT            : Lavf55.8.102
     Stream #0:0, 0, 1/25: Video: ffv1 (FFV1 / 0x31564646), yuv422p,
 720x576, 1/25, q=2-31, 200 kb/s, 25 tbn, 25 tbc
     Stream #0:1, 0, 1/48000: Audio: pcm_s16le ([1][0][0][0] / 0x0001),
 48000 Hz, stereo, s16, 1536 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> ffv1)
   Stream #1:0 -> #0:1 (pcm_s16le -> pcm_s16le)
 Press [q] to stop, [?] for help
 [alsa @ 0x18c4100] ALSA buffer xrun.
 *** drop!34 fps= 33 q=-1.0 size=   12461kB time=00:00:06.64
 bitrate=15373.7kbits/s
 *** drop!10 fps= 29 q=-1.0 size=   20059kB time=00:00:09.68
 bitrate=16975.1kbits/s dup=0 drop=1
 *** drop!74 fps= 28 q=-1.0 size=   26097kB time=00:00:12.24
 bitrate=17466.0kbits/s dup=0 drop=2
 *** drop!50 fps= 28 q=-1.0 size=   33596kB time=00:00:15.28
 bitrate=18011.9kbits/s dup=0 drop=3
 *** drop!26 fps= 27 q=-1.0 size=   40997kB time=00:00:18.32
 bitrate=18332.3kbits/s dup=0 drop=4
 *** drop!89 fps= 27 q=-1.0 size=   47234kB time=00:00:20.84
 bitrate=18567.1kbits/s dup=0 drop=5
 *** drop!66 fps= 27 q=-1.0 size=   54545kB time=00:00:23.92
 bitrate=18680.5kbits/s dup=0 drop=6
 frame=  575 fps= 26 q=-1.0 Lsize=   55804kB time=00:00:24.28
 bitrate=18828.2kbits/s dup=0 drop=7
 video:51696kB audio:4072kB subtitle:0 global headers:0kB muxing overhead
 0.064798%
 1091 frames successfully decoded, 0 decoding errors
 [AVIOContext @ 0x18ea9c0] Statistics: 10 seeks, 2242 writeouts
 }}}
 Sound has what I call "tics" after some "bips"
 and frames are dropped.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2478#comment:10>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list