hdla.blogg.se

Ffmpeg linux
Ffmpeg linux







To record a video webcam.mp4 from the webcam with audio: Where -video_size specifies the largest allowed image size from the webcam. $ ffmpeg -f v4l2 -video_size 640x480 -i /dev/video0 -c:v libx264 -preset ultrafast webcam.mp4 The following command will record a video webcam.mp4 from the webcam without audio, assuming that the webcam is correctly recognized under /dev/video0: If the video stream should not be saved as a file, but used as a virtual webcam for screen sharing purposes, see v4l2loopback#Casting X11 using FFmpeg.įFmpeg includes the video4linux2 and ALSA input devices that enable capturing webcam and audio input. Other codecs can be used if writing each frame is too slow (either due to inadequate disk performance or slow encoding), then frames will be dropped and video output will be choppy. Here, the x264 codec with the fastest possible encoding speed is used. $ ffmpeg -f x11grab -video_size 1920x1080 -framerate 25 -i $DISPLAY -f alsa -i default -c:v libx264 -preset ultrafast -c:a aac screen.mp4

ffmpeg linux

To take a screencast screen.mp4 with lossy encoding and with audio: Here, the Huffyuv codec is used, which is fast, but produces huge file sizes. $ ffmpeg -f x11grab -video_size 1920x1080 -framerate 25 -i $DISPLAY -c:v ffvhuff screen.mkv To take a screencast screen.mkv with lossless encoding and without audio: Where -video_size specifies the size of the area to capture. $ ffmpeg -f x11grab -video_size 1920x1080 -i $DISPLAY -vframes 1 screen.png See FFmpeg encoding wiki and ffmpeg(1) § EXAMPLES.įFmpeg includes the x11grab and ALSA virtual devices that enable capturing the entire user display and audio input. However you may want to force the number of threads available by the parameter -threads number.

ffmpeg linux ffmpeg linux

  • FFmpeg should automatically choose the number of CPU threads available.
  • Failing to do so may cause parameters being skipped or will prevent FFmpeg from executing.
  • It is important that parameters are specified in the correct order (e.g.








  • Ffmpeg linux