[FFmpeg-user] Comments about audio sync invited

James Linder jam at tigger.ws
Wed Jul 10 15:59:20 CEST 2013


On 09/07/2013, at 8:00 PM, Carl Eugen Hoyos wrote:

> James Linder <jam <at> tigger.ws> writes:
> 
>> ffmpeg version 1.0.6
> 
> This is old, please update to current git head.
> 
>> Input #0, pulse, from 'default':
>>  Duration: N/A, start: 0.636342, bitrate: 1536 kb/s
> 
>> Input #1, video4linux2,v4l2, from '/dev/video0':
>>  Duration: N/A, start: 1373359581.412447, bitrate: 23040 kb/s
> 
>> [avi at 0x6ae480] st:0 PTS: 352982 DTS: 
>> 352982 < 353004 invalid, clipping
> 
> These are the culprits (note the different start 
> times apart from the warning).
> 
> Please try -use_wallclock_as_timestamps (it is 
> possible that this only works with alsa).
> 
> [...]
> 
>>> is the problem also reproducible with ffmpeg 
>>> alone (without the pipe to ffplay)?
>> 
>> Hmmm without the ffplay display all looks good.
> 
> Maybe somebody who knows more about pipes can comment.
> 
>> I watch cpu usage at 50% odd.
> 
> What happens if you significantly reduce the load by 
> using a much smaller resolution?

If any kind soul can tell me why I'm being an idiot I would appreciate it so:

Just to recap:
I want to get audio and video synced
I want to display what is being recorded
Pulse lets them set the audio level visually
I want to NOT start jerk-display after an hour or so

I built git-head
I followed 
http://ffmpeg.org/trac/ffmpeg/wiki/Creating%20multiple%20outputs
and
http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20use%20-map%20option

[dvr] /home/dvr [132]% ./ffmpeg -f pulse -i default -f v4l2 -i /dev/video0 -vtag divx -s 384x288 -r pal -q:v 5 -f tee  -map 0:a -map 1:v Wed.avi | cat >Wed1.avi
ffmpeg version N-54580-g694550f Copyright (c) 2000-2013 the FFmpeg developers
  built on Jul 10 2013 11:43:58 with gcc 4.7 (SUSE Linux)
  configuration: --enable-libv4l2 --enable-libpulse
  libavutil      52. 38.100 / 52. 38.100
  libavcodec     55. 18.102 / 55. 18.102
  libavformat    55. 11.101 / 55. 11.101
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 79.100 /  3. 79.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, pulse, from 'default':
  Duration: N/A, start: 0.005521, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Input #1, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 1373462222.886516, bitrate: 92160 kb/s
    Stream #1:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x480, 92160 kb/s, 25 fps, 25 tbr, 1000k tbn, 1000k tbc
Output #0, tee, to 'Wed.avi':
    Stream #0:0: Audio: none, 0 channels, 128 kb/s
    Stream #0:1: Video: none (divx / 0x78766964), 384x288, q=2-31, 128 kb/s, 90k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> ?)
  Stream #1:0 -> #0:1 (rawvideo -> ?)
Encoder (codec none) not found for output stream #0:0

Step #1 is to get 2 streams that are the same (I assume | cat will not cause performance issues)

Thanks
James



More information about the ffmpeg-user mailing list