What I would like to do is in the title :
I successfully found the way to encode live camera stream using h264_omx using nearly no CPU at all (awesome).
Code: Select all
ffmpeg -f v4l2 -video_size 1280x800 -i /dev/video0 -codec:v h264_omx -b:v 2048k webcam.mkv
Whithout h264_omx, the only codec that is able to run almost fine on a Pi4 is "-codec:v mpeg4" (but is still uses lot of CPU compared with h264_omx).
Struggling some hours with VLC, I successfully found a way to tell VLC to stream using ffmpeg and mpeg4 codec.
Code: Select all
cvlc v4l2:///dev/video0:width=1280:height=800 --sout '#transcode{vcodec=mp4v,scale=Auto,acodec=none,scodec=none}:http{mux=ffmpeg{mux=avi},dst=:8080/}' -vvv
But that's not satisfying at all : this is quite low quality and this is not using the h264_omx functionality of ffmpeg. On Pi3B+ this is too slow and pictures are in increasing late with some "delay reset" at fixed intervals (catastrophic).
As VLC "vcodec=xxxx" parameter only keep the 4 first characters, and the list of recognized commands is here https://wiki.videolan.org/Codec/ it seems that I need to write the command differently. But I have no idea how to do so.
If someone is able to tell me how to acheive this very last step, thank you in advance !