ffmpeg cannot capture h264 from webcam C920

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ffmpeg cannot capture h264 from webcam C920

andrea
Hi,

I have the same issue reported here

http://ffmpeg.org/pipermail/ffmpeg-user/2013-May/015046.html
and
http://ffmpeg.org/pipermail/ffmpeg-user/2013-July/016243.html

I have tried ffmpeg 1.2.2 on fedora and 2.0.1 on raspberry (same result).
I have only tried ffplay 1.2.2 on fedora.

if I use ffplay I get some output (a few seconds then still).



ffplay -f v4l2 -input_format h264 /dev/video0

ffplay version 1.2.2 Copyright (c) 2003-2013 the FFmpeg developers
  built on Aug  4 2013 08:23:55 with gcc 4.8.1 (GCC) 20130603 (Red Hat 4.8.1-1)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg
--incdir=/usr/include/ffmpeg --libdir=/usr/lib --mandir=/usr/share/man --arch=i686 --optflags='-O2
-g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
-grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' --enable-bzlib
--disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcelt
--enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame
--enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2
--enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug
--disable-stripping --shlibdir=/usr/lib --cpu=i686 --enable-runtime-cpudetect
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[video4linux2,v4l2 @ 0xb1b025c0] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 3512.615770, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p, 640x480 [SAR 1:1 DAR 4:3], -5 kb/s,
30 fps, 30 tbr, 1000k tbn, 60 tbc
3516.23 A-V:  0.000 fd=  10 aq=    0KB vq=   77KB sq=    0B f=8/8

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg cannot capture h264 from webcam C920

Carl Eugen Hoyos
andrea <mariofutire <at> googlemail.com> writes:

> I have the same issue reported here
>
> http://ffmpeg.org/pipermail/ffmpeg-user/2013-May/015046.html
> and
> http://ffmpeg.org/pipermail/ffmpeg-user/2013-July/016243.html
>
> I have tried ffmpeg 1.2.2 on fedora and 2.0.1 on raspberry
> (same result). I have only tried ffplay 1.2.2 on fedora.

Iirc, all users so far reported (repeatedly) that ffplay
works fine with this camera (as does reencoding with ffmpeg).
Please test reencoding with current ffmpeg and report back.
(current != 2.0.1 !)

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg cannot capture h264 from webcam C920

William C Bonner-2
I finally figured out that to use FFMPEG directly with the logitech C920
camera doing h.264 encoding, I need to use the -copyinkf flag.

ffmpeg -report -s 1920x1080 f v4l2 -vcodec h264 -i /dev/video0 -copyinkf
-vcodec copy test.mp4


On Thu, Aug 29, 2013 at 2:57 AM, Carl Eugen Hoyos <[hidden email]> wrote:

> andrea <mariofutire <at> googlemail.com> writes:
>
> > I have the same issue reported here
> >
> > http://ffmpeg.org/pipermail/ffmpeg-user/2013-May/015046.html
> > and
> > http://ffmpeg.org/pipermail/ffmpeg-user/2013-July/016243.html
> >
> > I have tried ffmpeg 1.2.2 on fedora and 2.0.1 on raspberry
> > (same result). I have only tried ffplay 1.2.2 on fedora.
>
> Iirc, all users so far reported (repeatedly) that ffplay
> works fine with this camera (as does reencoding with ffmpeg).
> Please test reencoding with current ffmpeg and report back.
> (current != 2.0.1 !)
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg cannot capture h264 from webcam C920

andrea
On 31/08/13 21:08, William C Bonner wrote:
> I finally figured out that to use FFMPEG directly with the logitech C920
> camera doing h.264 encoding, I need to use the -copyinkf flag.
>
> ffmpeg -report -s 1920x1080 f v4l2 -vcodec h264 -i /dev/video0 -copyinkf
> -vcodec copy test.mp4
>

bingo!

it works now.
there are tons of warnings

[mp4 @ 0x181bff0] Non-monotonous DTS in output stream 0:0; previous: 11474308, current: 11431709;
changing to 11474309. This may result in incorrect timestamps in the output file.

Non-monotonous DTS in output stream 0:0; previous: 11972804, current: 11802063; changing to
11972805. This may result in incorrect timestamps in the output file.


need to find the right way to silence them

thank you very much.


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user