[FFmpeg-trac] #10037(ffmpeg:new): EXT-X-STREAM-INF is missing CODECS attribute when using h264_v4l2m2m encoder
FFmpeg
trac at avcodec.org
Mon Nov 14 20:20:50 EET 2022
#10037: EXT-X-STREAM-INF is missing CODECS attribute when using h264_v4l2m2m
encoder
------------------------------------+----------------------------------
Reporter: nls | Type: defect
Status: new | Priority: normal
Component: ffmpeg | Version: 5.1.2
Keywords: ffmpeg HLS | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
------------------------------------+----------------------------------
Summary of the bug:
Trying to encode for HLS live stream using ffmpeg on a Raspberry Pi 4.
Everything is working but the EXT-X-STREAM-INF is missing the CODECS
attribute that's present for other h264 encoders like libx264 or the old
OMX encoder. We don't use audio in these streams. This makes the stream
break in Chrome, because it assumes an audio track when the CODECS attrib
is missing.
A possible cause is the v4l2 driver's inability to take the -profile
parameter, so it must be omitted from the command line. This might affect
the logic for adding the attribute (a wild guess).
How to reproduce:
{{{
Command:
ffmpeg-new -f v4l2 -thread_queue_size 1024 -input_format yuyv422 -r 30
-video_size 1280x720 -i /dev/video0 -filter:v scale=1024:576 -f hls
-hls_playlist_type event -hls_segment_filename
http://localhost:3000/upload/segment_04_%06d.ts -master_pl_name
master_04.m3u8 -hls_time 6 -c:v h264_v4l2m2m -level:v 4.2 -b:v 2000k
-pix_fmt yuv420p -threads 4 -maxrate 1500k -force_key_frames
expr:gte(t,n_forced*6) -keyint_min 30 -ss 1 -movflags faststart -headers
content-type: application/octet-stream? -method POST
http://localhost:3000/upload/stream_04.m3u8
ffmpeg output:
ffmpeg version 5.1.1-static https://johnvansickle.com/ffmpeg/ Copyright
(c) 2000-2022 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
configuration: --enable-gpl --enable-version3 --enable-static --disable-
debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio
--cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp
--enable-libgme --enable-gray --enable-libfribidi --enable-libass
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-librubberband --enable-libsoxr
--enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus
--enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-
libvpx --enable-libwebp --enable-libx264 --enable-libxml2 --enable-libxvid
--enable-libzimg
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
[video4linux2,v4l2 @ 0x4229a60] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, start: 0.000000, bitrate: 442368 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720,
442368 kb/s, 30 fps, 30 tbr, 1000k tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_v4l2m2m))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x4229a60] Dequeued v4l2 buffer contains corrupted
data (0 bytes).
Last message repeated 30 times
[h264_v4l2m2m @ 0x422dff0] Using device /dev/video11
[h264_v4l2m2m @ 0x422dff0] driver 'bcm2835-codec' on card 'bcm2835-codec-
encode' in mplane mode
[h264_v4l2m2m @ 0x422dff0] requesting formats: output=YU12 capture=H264
[h264_v4l2m2m @ 0x422dff0] Failed to set gop size: Invalid argument
Output #0, hls, to 'http://localhost:3000/upload/stream_04.m3u8':
Metadata:
encoder : Lavf59.27.100
Stream #0:0: Video: h264, yuv420p(tv, progressive), 1024x576, q=2-31,
1500 kb/s, 15 fps, 90k tbn
Metadata:
encoder : Lavc59.37.100 h264_v4l2m2m
[hls @ 0x422b220] Opening
'http://localhost:3000/upload/segment_04_000000.ts' for writing
[hls @ 0x422b220] Opening 'http://localhost:3000/upload/master_04.m3u8'
for writing
[hls @ 0x422b220] Opening
'http://localhost:3000/upload/segment_04_000001.ts' for writing
frame= 149 fps= 29 q=-0.0 Lsize=N/A time=00:00:10.00 bitrate=N/A
speed=0.891x
video:910kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
Exiting normally, received signal 2.
}}}
Correct master manifest:
{{{
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-
INF:BANDWIDTH=1320000,RESOLUTION=1024x576,CODECS="avc1.64002a"
stream_04.m3u8
}}}
Incorrect master manifest:
{{{
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=1650000,RESOLUTION=1024x576
stream_04.m3u8
}}}
Environment:
{{{
OS: Debian 11.5 (Raspberry OS)
Kernel: 5.15.61-v7l+
ffpmeg 5.1.1 static from https://johnvansickle.com/ffmpeg/
}}}
The 20220910 build from https://johnvansickle.com/ffmpeg/ exhibits the
same issue (can't use that because of another bug).
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10037>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list