[FFmpeg-user] hardware encoder h264_v4l2m2m doesn't produce valid dash

Alan dartagnan64b at gmail.com
Mon Feb 28 07:18:31 EET 2022


Hello,

I'm capturing video from a usb capture (hdmi to usb) and converting it to
dash via ffmpeg and then serving it via nginx.  The FFmpeg 4.3.3 command
line I'm using on Raspberry Pi 3:

sudo ffmpeg -y -f v4l2 -input_format yuyv422 -video_size 1920x1080
-framerate 5 -i /dev/video0 -vcodec h264_v4l2m2m -pix_fmt yuv420p
-keyint_min 30 -g 30 -map 0:v -b:v 1000k -level 41 -profile:v 77 -f dash
-seg_duration 1 -streaming 1 -window_size 30 -remove_at_exit 1
-dash_segment_type 1 /dev/shm/source1/live.mpd

The live.mpd produced seems to not have the correct mime for codec. See
codecs= in these two examples:

Got:
<Representation id="0" mimeType="video/mp4" codecs="avc1"
bandwidth="1000000" width="1920" height="1080" sar="1:1">

Expect:
<Representation id="0" mimeType="video/mp4" codecs="avc1.420029"
bandwidth="37678" width="1280" height="800" sar="1:1">

The missing part after avc1 seems to cause the browser to not play the
video stream and bork with error:
Cannot play media. No decoders for requested formats:
video/mp4;codecs="avc1";width="1920";height="1080"

Any suggestions on how to resolve this?

Thanks a bunch


More information about the ffmpeg-user mailing list