shinykongcn 发表于 2016-11-15 09:46
活生生的干货,赶紧收藏
编译 git 版本
运行
ffmpeg -f v4l2 -r 15 -video_size vga -pix_fmt yuv420p -i /dev/video0 -b:v 500k -c:v h264 -an -f mp4 picam.mp4 -y
ffmpeg version N-82629-g9955123 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.9.2 (Raspbian 4.9.2-10)
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-static --disable-shared --prefix=/usr/local --disable-opencl --disable-thumb --disable-pic --disable-stripping --enable-small --enable-ffmpeg --enable-ffplay --enable-ffserver --enable-ffprobe --disable-doc --disable-htmlpages --disable-podpages --disable-txtpages --disable-manpages --disable-everything --enable-libx264 --enable-encoder=libx264 --enable-decoder=h264 --enable-encoder=aac --enable-decoder=aac --enable-encoder=ac3 --enable-decoder=ac3 --enable-muxer=flv --enable-demuxer=flv --enable-muxer=mp4 --enable-demuxer=mpegvideo --enable-muxer=matroska --enable-demuxer=matroska --enable-muxer=wav --enable-demuxer=wav --enable-muxer='pcm*' --enable-demuxer='pcm*' --enable-muxer=rawvideo --enable-demuxer=rawvideo --enable-parser=h264 --enable-parser=aac --enable-protocol=file --enable-protocol=tcp --enable-protocol=rtmp --enable-protocol=cache --enable-filter=aresample --enable-indev=v4l2 --enable-indev=alsa --enable-omx --enable-omx-rpi --enable-encoder=h264_omx --enable-mmal --enable-hwaccel=h264_mmal --enable-decoder=h264_mmal
libavutil 55. 41.101 / 55. 41.101
libavcodec 57. 66.107 / 57. 66.107
libavformat 57. 58.100 / 57. 58.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 67.100 / 6. 67.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
[video4linux2,v4l2 @ 0x13f5360] The driver does not permit changing the time per frame
[video4linux2,v4l2 @ 0x13f5360] Time per frame unknown
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 19481.966811, bitrate: N/A
Stream #0:0: Video: mjpeg, none, 640x480, 31 tbr, 1000k tbn, 1000k tbc
Stream mapping:
Stream #0:0 -> #0:0 (? (?) -> h264 (libx264))
Decoder (codec mjpeg) not found for input stream #0:0