主题 : tiny6410移植ffmpeg无法采集v4l2摄像头 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 117579
精华: 0
发帖: 17
金钱: 85 两
威望: 17 点
综合积分: 34 分
注册时间: 2015-07-21
最后登录: 2017-02-08
楼主  发表于: 2016-05-12 14:03

 tiny6410移植ffmpeg无法采集v4l2摄像头

我移植了x264,
命令一直停留在第一副图片,

[root@yb bin]# ./ffmpeg  -f  video4linux2  -s  320x240  -i  /dev/video2  ./test.
mp4
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.5.1 (ctng-1.8.1-FA)
  configuration: --cross-prefix=arm-linux- --enable-cross-compile --target-os=linux --cc=arm-linux-gcc --arch=arm --prefix=/usr/local/arm_ffmpeg --enable-shared --disable-static --enable-gpl --enable-nonfree --enable-ffmpeg --disable-ffplay --enable-ffserver --enable-swscale --enable-pthreads --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-yasm --disable-stripping --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib --enable-libx264
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100

按ctrl+c,进入第二幅图片
  libpostproc    54.  0.100 / 54.  0.100
Input #0, video4linux2,v4l2, from '/dev/video2':
  Duration: N/A, bitrate: 4915 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 4915 kb/s, 4 fps, 4 tbr, 1000k tbn, 1000k tbc
No pixel format specified, yuv422p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x437e0] using cpu capabilities: none!
[libx264 @ 0x437e0] profile High 4:2:2, level 1.2, 4:2:2 8-bit
[libx264 @ 0x437e0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=4 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to './test.mp4':
  Metadata:
    encoder         : Lavf57.25.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv422p, 320x240, q=-1--1, 4 fps, 16384 tbn, 4 tbc
    Metadata:
      encoder         : Lavc57.24.102 libx264
    Side data:
      unknown side data type 10 (24 bytes)
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Could not write header for output file #0 (incorrect codec parameters ?): Immediate exit requested
Exiting normally, received signal 2.
[root@yb bin]#

采集摄像头一直无法进行,求大神帮助
将输出文件名改为test.flv
则是这样的
Input #0, video4linux2,v4l2, from '/dev/video2':
  Duration: N/A, bitrate: 4915 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 4915 kb/s, 4 fps, 4 tbr, 1000k tbn, 1000k tbc
Output #0, flv, to './test.flv':
  Metadata:
    encoder         : Lavf57.25.100
    Stream #0:0: Video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 320x240, q=2-31, 200 kb/s, 4 fps, 1k tbn, 4 tbc
    Metadata:
      encoder         : Lavc57.24.102 flv
    Side data:
      unknown side data type 10 (24 bytes)
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> flv1 (flv))
Press [q] to stop, [?] for help
Error writing trailer of ./test.flv: Immediate exit requestedframe=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=N/A    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
Exiting normally, received signal 2.
[ 此帖被千凡在2016-05-12 14:23重新编辑 ]