[FFmpeg-user] Record from webcam. Record video only is OK. Record video and audio fails.

Thomas Seilund tps at netmaster.dk
Tue Feb 24 18:20:33 CET 2015


Thomas Seilund writes:

> Hi All,
>
> I record from a Logitech HD Pro C920 webcam.
>
> Case 1 below
> If I record video only then the play back is ok
>
> Case 2 below
> If I record video and audio then the play back runs way to fast.
>
> Case 3 below
> If I record audio only then the play back is ok.
>
>

I compiled with pulse audio support and now I use the command line and it  
works!

tps at t420:~/temp$ ffmpeg -y -f v4l2 -r 24 -s 640x360 -i /dev/video1 -f pulse  
-i 2 -r 24 -c:v libx264 -pix_fmt yuv420p -preset ultrafast -c:a aac -b:a  
128k -ar 44100 -strict -2 -f mpegts test2.ts
ffmpeg version N-69238-g2699a37 Copyright (c) 2000-2015 the FFmpeg  
developers
   built on Feb 24 2015 18:13:15 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
   configuration: --enable-gpl --enable-libmp3lame --enable-libvpx --enable- 
libx264 --enable-version3 --enable-libvorbis --enable-libfreetype --enable- 
libv4l2 --enable-libfdk-aac --enable-nonfree --enable-libpulse
   libavutil      54. 17.100 / 54. 17.100
   libavcodec     56. 20.100 / 56. 20.100
   libavformat    56. 19.100 / 56. 19.100
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5.  8.101 /  5.  8.101
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
Input #0, video4linux2,v4l2, from '/dev/video1':
   Duration: N/A, start: 5275.972254, bitrate: 88473 kb/s
     Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x360,  
88473 kb/s, 24 fps, 24 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for  Input Stream #1.0 : stereo
Input #1, pulse, from '2':
   Duration: N/A, start: 1424798318.602732, bitrate: 1536 kb/s
     Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[libx264 @ 0x3535700] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x3535700] profile Constrained Baseline, level 3.0
Output #0, mpegts, to 'test2.ts':
   Metadata:
     encoder         : Lavf56.19.100
     Stream #0:0: Video: h264 (libx264), yuv420p, 640x360, q=-1--1, 24 fps,  
90k tbn, 24 tbc
     Metadata:
       encoder         : Lavc56.20.100 libx264
     Stream #0:1: Audio: aac, 44100 Hz, stereo, fltp, 128 kb/s
     Metadata:
       encoder         : Lavc56.20.100 aac
Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
   Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
frame=  163 fps= 25 q=-1.0 Lsize=     834kB time=00:00:06.79  
bitrate=1005.4kbits/s
video:646kB audio:102kB subtitle:0kB other streams:0kB global headers:0kB  
muxing overhead: 11.427479%
[libx264 @ 0x3535700] frame I:1     Avg QP:20.00  size: 23826
[libx264 @ 0x3535700] frame P:162   Avg QP:21.30  size:  3936
[libx264 @ 0x3535700] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x3535700] mb P  I16..4:  1.8%  0.0%  0.0%  P16..4: 43.6%  0.0%   
0.0%  0.0%  0.0%    skip:54.6%
[libx264 @ 0x3535700] coded y,uvDC,uvAC intra: 25.2% 49.6% 23.2% inter:  
19.2% 19.8% 1.8%
[libx264 @ 0x3535700] i16 v,h,dc,p: 42% 18% 23% 17%
[libx264 @ 0x3535700] i8c dc,h,v,p: 55% 22% 19%  5%
[libx264 @ 0x3535700] kb/s:779.16
tps at t420:~/temp$


Thanks

Thomas S


More information about the ffmpeg-user mailing list