Rock 5C Lite H264 Streaming (Browser) Experiments

Giving up on HTML5 MediaSource , i can’t write mp4 to pipe and all codecs i tried failed:

// var mimeCodec = ‘video/mp4; codecs=“avc1.4d002a”’;
var mimeCodec = ‘video/mp4;codecs=“avc1.64001E”’;
// var mimeCodec = ‘video/mp4; codecs=“avc1.4D0033, mp4a.40.2”’;

I tested with an H264 USB camera module.
After some trying i found that JMuxer works best with:

JVT NAL sequence, H.264 video, main @ L 41
latency: 1 sec.

v4l2 command:

v4l2-ctl --verbose -d /dev/video23 --set-fmt-video=width=1920,height=1080 --stream-mmap=4 --set-selection=target=crop,flags=0,top=0,left=0,width=1920,height=1080 --stream-to=stream.h264

The closest i get with the ffmpeg pipe:

ffmpeg -f v4l2 -input_format nv12 -framerate 30 -video_size 1920x1080 -i /dev/video11 -c:v h264_rkmpp -qp_init 22 -movflags frag_keyframe+empty_moov+faststart -b:v 4000K -vprofile main -vf format=yuv420p -r 25 -bufsize 600k stream.h264 -y

JVT NAL sequence, H.264 video, main @ L 40
latency: 30 sec.

1 Like