[FFmpeg-user] Use of -hls_flags iframes_only results in incorrect EXT-X-VERSION value

Bruce Roberts roberb04 at gmail.com
Tue Jan 19 12:57:41 EET 2021


Hello,

I'm trying to generate Apple mediastreamvalidator compliant HLS using
ffmpeg and have very nearly achieved that.

The only remaining problem is that use of " -hls_flags iframes_only"
correctly adds the #EXT-X-I-FRAMES-ONLY tag to my trickplay m3u8 but it
doesn't increment the #EXT-X-VERSION value from 3 to 4.

The validator then complains as follows:

--------------------------------------------------------------------------------

MUST fix issues

--------------------------------------------------------------------------------



Error: incorrect version number for feature

--> Detail:  Line: (null)

--> Source:  output_TrickPlay_Video_8bit.m3u8

If I manually edit the file and change the version value to 4, validation
is successful.

I have upgraded ffmpeg to the latest version but the problem remains.

Is there a way for me to force #EXT-X-VERSION:4 ?

Here is my command and the console output:

ffmpeg \
-ss 00:00:00.000 -t 00:00:30.000 -i input_23.98fps.mxf \
-filter_complex \
"[0:v:0]format=pix_fmts=yuv420p[vconcat420p8bit]; \
[vconcat420p8bit]split=3[vconcat1][vconcat2][vconcat3]; \
[vconcat3]fps=1.001000[vconcat1fps]; \
[0:a:0][0:a:1]join=inputs=2:channel_layout=stereo[stereo]" \
-map "[vconcat1]" -f hls -hls_list_size 0 -hls_time 6.006
-hls_playlist_type vod -an -vcodec libx264 -flags +cgop -g 48 -b:v 2500k
-maxrate 2500k -bufsize 2500k -x264opts
nal-hrd=cbr:bframes=0:keyint=48:min-keyint=48:scenecut=-1 \
output_T0_Video_8bit.m3u8 \
-map "[vconcat2]" -f hls -hls_list_size 0 -hls_time 6.006
-hls_playlist_type vod -an -vcodec libx264 -flags +cgop -g 48 -b:v 250k
-maxrate 250k -bufsize 250k -x264opts
nal-hrd=cbr:bframes=0:keyint=48:min-keyint=48:scenecut=-1 \
output_T1_Video_8bit.m3u8 \
-map "[stereo]" -f hls -hls_list_size 0 -hls_time 6.006 -hls_playlist_type
vod -vn -acodec libfdk_aac -b:a 120k -ar 48000 NEW_output_T1_Audio.m3u8 \
-map "[vconcat1fps]" -f hls -hls_list_size 0 -hls_time 6.006
-hls_playlist_type vod -hls_flags iframes_only -an -vcodec libx264 -intra
-b:v 250k -maxrate 250k -bufsize 250k \
output_TrickPlay_Video_8bit.m3u8 \

ffmpeg version git-2021-01-13-f6477ac9 Copyright (c) 2000-2021 the FFmpeg
developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.28)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-f6477ac_6
--enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-gpl
--enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus
--enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx
--enable-libx264 --enable-libx265 --enable-libfontconfig
--enable-libfreetype --enable-frei0r --enable-libass --enable-demuxer=dash
--disable-libjack --disable-indev=jack --enable-opencl
--enable-videotoolbox --disable-htmlpages --enable-libfdk-aac
--enable-nonfree
  libavutil      56. 63.101 / 56. 63.101
  libavcodec     58.117.100 / 58.117.100
  libavformat    58. 65.101 / 58. 65.101
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 95.100 /  7. 95.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Input #0, mxf, from 'input_23.98fps.mxf':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
    uid             : ec3f5416-a722-1dcc-8f60-d4f34e4a603d
    generation_uid  : 296bd6eb-2ca9-1321-bbef-5f5f4cfc10ec
    company_name    : Telestream Inc.
    product_name    : Telestream Media Framework - Release TXGP
    product_version : 2016.30.183822
    modification_date: 2020-12-15T15:24:55.000000Z
    product_uid     : 11350ec5-148a-1010-aaca-d2c1000f040a
    material_package_umid:
0x060A2B340101010501010F1213296BD6EB2CA90321BB1F5F9F4CFC10ECBED4ED
    timecode        : 00:58:30:00
  Duration: 00:45:07.12, start: 0.000000, bitrate: 93297 kb/s
    Stream #0:0: Data: none
    Metadata:
      file_package_umid:
0x060A2B340101010501010F12135106454D99258E516513059C33EC3F5416A722
      data_type       : vbi_vanc_smpte_436M
    Stream #0:1: Video: h264 (High 4:2:2 Intra), yuv422p10le(pc, bt709,
progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 23.98
tbn, 47.95 tbc
    Metadata:
      file_package_umid:
0x060A2B340101010501010F12135106454D99258E516513059C33EC3F5416A722
    Stream #0:2: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid:
0x060A2B340101010501010F12135106454D99258E516513059C33EC3F5416A722
    Stream #0:3: Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s
    Metadata:
      file_package_umid:
0x060A2B340101010501010F12135106454D99258E516513059C33EC3F5416A722
Stream mapping:
  Stream #0:1 (h264) -> format
  Stream #0:2 (pcm_s24le) -> join:input0
  Stream #0:3 (pcm_s24le) -> join:input1
  split:output0 -> Stream #0:0 (libx264)
  split:output1 -> Stream #1:0 (libx264)
  join -> Stream #2:0 (libfdk_aac)
  fps -> Stream #3:0 (libx264)
Press [q] to stop, [?] for help
[libx264 @ 0x7fb52d814800] using SAR=1/1
[libx264 @ 0x7fb52d814800] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fb52d814800] profile High, level 4.0
[libx264 @ 0x7fb52d814800] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options:
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24
lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=48
keyint_min=25 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=cbr mbtree=1
bitrate=2500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4
vbv_maxrate=2500 vbv_bufsize=2500 nal_hrd=cbr filler=1 ip_ratio=1.40
aq=1:1.00
Output #0, hls, to 'output_T0_Video_8bit.m3u8':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
    uid             : ec3f5416-a722-1dcc-8f60-d4f34e4a603d
    generation_uid  : 296bd6eb-2ca9-1321-bbef-5f5f4cfc10ec
    company_name    : Telestream Inc.
    product_name    : Telestream Media Framework - Release TXGP
    product_version : 2016.30.183822
    modification_date: 2020-12-15T15:24:55.000000Z
    product_uid     : 11350ec5-148a-1010-aaca-d2c1000f040a
    material_package_umid:
0x060A2B340101010501010F1213296BD6EB2CA90321BB1F5F9F4CFC10ECBED4ED
    timecode        : 00:58:30:00
    encoder         : Lavf58.65.101
    Stream #0:0: Video: h264, yuv420p(tv, bt709, progressive), 1920x1080
[SAR 1:1 DAR 16:9], q=2-31, 2500 kb/s, 23.98 fps, 90k tbn (default)
    Metadata:
      encoder         : Lavc58.117.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 2500000/0/2500000 buffer size: 2500000
vbv_delay: N/A
[libx264 @ 0x7fb52d818800] using SAR=1/1
[libx264 @ 0x7fb52d818800] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fb52d818800] profile High, level 4.0
[libx264 @ 0x7fb52d818800] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options:
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24
lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=48
keyint_min=25 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=cbr mbtree=1
bitrate=250 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4
vbv_maxrate=250 vbv_bufsize=250 nal_hrd=cbr filler=1 ip_ratio=1.40 aq=1:1.00
Output #1, hls, to 'output_T1_Video_8bit.m3u8':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
    uid             : ec3f5416-a722-1dcc-8f60-d4f34e4a603d
    generation_uid  : 296bd6eb-2ca9-1321-bbef-5f5f4cfc10ec
    company_name    : Telestream Inc.
    product_name    : Telestream Media Framework - Release TXGP
    product_version : 2016.30.183822
    modification_date: 2020-12-15T15:24:55.000000Z
    product_uid     : 11350ec5-148a-1010-aaca-d2c1000f040a
    material_package_umid:
0x060A2B340101010501010F1213296BD6EB2CA90321BB1F5F9F4CFC10ECBED4ED
    timecode        : 00:58:30:00
    encoder         : Lavf58.65.101
    Stream #1:0: Video: h264, yuv420p(tv, bt709, progressive), 1920x1080
[SAR 1:1 DAR 16:9], q=2-31, 250 kb/s, 23.98 fps, 90k tbn (default)
    Metadata:
      encoder         : Lavc58.117.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 250000/0/250000 buffer size: 250000
vbv_delay: N/A
[mpegts @ 0x7fb52c214400] frame size not set
Output #2, hls, to 'NEW_output_T1_Audio.m3u8':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
    uid             : ec3f5416-a722-1dcc-8f60-d4f34e4a603d
    generation_uid  : 296bd6eb-2ca9-1321-bbef-5f5f4cfc10ec
    company_name    : Telestream Inc.
    product_name    : Telestream Media Framework - Release TXGP
    product_version : 2016.30.183822
    modification_date: 2020-12-15T15:24:55.000000Z
    product_uid     : 11350ec5-148a-1010-aaca-d2c1000f040a
    material_package_umid:
0x060A2B340101010501010F1213296BD6EB2CA90321BB1F5F9F4CFC10ECBED4ED
    timecode        : 00:58:30:00
    encoder         : Lavf58.65.101
    Stream #2:0: Audio: aac, 48000 Hz, stereo, s16, 120 kb/s (default)
    Metadata:
      encoder         : Lavc58.117.100 libfdk_aac
[libx264 @ 0x7fb52d820200] using SAR=1/1
[libx264 @ 0x7fb52d820200] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fb52d820200] profile High, level 4.0
[libx264 @ 0x7fb52d820200] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options:
cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24
lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=1
keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=1 rc=cbr mbtree=0
bitrate=250 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4
vbv_maxrate=250 vbv_bufsize=250 nal_hrd=none filler=0 ip_ratio=1.40
aq=1:1.00
Output #3, hls, to 'output_TrickPlay_Video_8bit.m3u8':
  Metadata:
    operational_pattern_ul: 060e2b34.04010101.0d010201.01010900
    uid             : ec3f5416-a722-1dcc-8f60-d4f34e4a603d
    generation_uid  : 296bd6eb-2ca9-1321-bbef-5f5f4cfc10ec
    company_name    : Telestream Inc.
    product_name    : Telestream Media Framework - Release TXGP
    product_version : 2016.30.183822
    modification_date: 2020-12-15T15:24:55.000000Z
    product_uid     : 11350ec5-148a-1010-aaca-d2c1000f040a
    material_package_umid:
0x060A2B340101010501010F1213296BD6EB2CA90321BB1F5F9F4CFC10ECBED4ED
    timecode        : 00:58:30:00
    encoder         : Lavf58.65.101
    Stream #3:0: Video: h264, yuv420p(tv, bt709, progressive), 1920x1080
[SAR 1:1 DAR 16:9], q=2-31, 250 kb/s, 1 fps, 90k tbn (default)
    Metadata:
      encoder         : Lavc58.117.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 250000/0/250000 buffer size: 250000
vbv_delay: N/A

Here is the complete unedited output_TrickPlay_Video_8bit.m3u8:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:7
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-I-FRAMES-ONLY
#EXTINF:6.993011,
output_TrickPlay_Video_8bit0.ts
#EXTINF:5.994000,
output_TrickPlay_Video_8bit1.ts
#EXTINF:5.994011,
output_TrickPlay_Video_8bit2.ts
#EXTINF:5.994000,
output_TrickPlay_Video_8bit3.ts
#EXTINF:4.995000,
output_TrickPlay_Video_8bit4.ts
#EXT-X-ENDLIST

Many thanks!
Bruce.


More information about the ffmpeg-user mailing list