FFmpeg does provide a multitude of options for encoding, but those may require you to specify a raw video -input_format from v4l2 and use FFmpeg's x264 encoder instead, which could be much slower than a hardware encoder.Äisclaimer: this question probably belongs on Super User or Video Production rather than Stack Overflow, since it only deals with the command-line tool. It is not clear from the ffmpeg documentation for v4l2 how to provide additional flags (such as h264_profile and repeat_sequence_header) to v4l2. This option is generally used when encoding for a piece of hardware with bitrate limitations. You can use v4l2-ctl -list-devices to see which devices are available. -vbv-maxrate (x264) -maxrate (FFmpeg) Specifies the maximum bitrate at any point in the video.Note: this assumes your input device is /dev/video0. You will need to specify your output format and options depending on your use case. ![]() It looks like you are trying to use h264, so you are probably looking for something along these lines: ffmpeg -f video4linux2 -input_format h264 -video_size 640x480 -framerate 30 -i /dev/video0 out.h264įFmpeg will tell v4l2 to provide an h264-encoded stream with the given framerate and size as an input to ffmpeg, which will copy the stream into the file out.h264. Depending on your device, v4l2 can provide video in several different formats (for example, raw video like yuv420p, or compressed video like h264, possibly via a hardware accelerator). You can tell FFmpeg to use video4linux2 (v4l2) as an input "device" ( which it treats like a demuxer).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |