1

I'm trying to capture a .mp4 video using RPi + picamera and ffmpeg but I can't do this with this command

raspivid -t 50000 -fps 25 -b 500000 -vf -o - | ffmpeg -i - -vcodec copy -an -f lavfi -r 25 -t 50000 -pix_fmt yuv420p recording-1.mp4



 pi@raspberrypi:~ $ raspivid -t 50000 -fps 25 -b 500000 -vf -o - | ffmpeg -i - -vcodec copy -an -f lavfi -r 25 -t 50000 -pix_fmt yuv420p recording-1.mp4
ffmpeg version N-77945-gd6b3062 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.9.2 (Raspbian 4.9.2-10)
  configuration: --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
  libavutil      55. 13.100 / 55. 13.100
  libavcodec     57. 22.100 / 57. 22.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 25.100 /  6. 25.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, h264, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p, 1920x1080, 25 fps, 25 tbr, 1200k tbn, 50 tbc
[NULL @ 0x1f1b580] Requested output format 'lavfi' is not a suitable output format
recording-1.mp4: Invalid argument

if I'm trying to do the same for .flv video it works fine

raspivid -t 50000 -fps 25 -b 500000 -vf -o - | ffmpeg -i - -vcodec copy -an -f flv -r 25 -t 50000 -pix_fmt yuv420p recording-3.flv

I don't understand where my mistake is, can some one help?

  • What is the output of ffmpeg -formats? – Bex Jan 20 '16 at 12:44
0

lavfi (Libavfilter input virtual device) is an INPUT format. Here you have it as an output format.

https://www.ffmpeg.org/ffmpeg-devices.html#lavfi

FLV (Flash Video) IS an output format. That's why the second one works for you.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.