[FFmpeg-trac] #11502(avformat:new): HLS var_stream_map for vtt
FFmpeg
trac at avcodec.org
Tue Mar 11 11:14:51 EET 2025
#11502: HLS var_stream_map for vtt
-------------------------------------+-------------------------------------
Reporter: mars | Type: defect
Status: new | Priority: normal
Component: avformat | Version:
| unspecified
Keywords: HLS webvtt | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Hello, I'm trying to find a solution to create a master playlist for hls.
If I run the command from the documentation
`````````````````````````````````````````````````````````````````````````````````````````````````````````````````
ffmpeg -y -i input_with_subtitle.mkv \
-b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
-b:a:0 256k \
-c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
-f hls -var_stream_map "v:0,a:0,s:0,sgroup:subtitle,sname:English" \
-master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4
-hls_list_size \
10 -master_pl_publish_rate 10 -hls_flags \
delete_segments+discont_start+split_by_time ./tmp/video.m3u8
`````````````````````````````````````````````````````````````````````````````````````````````````````````````````
it works correctly. But when I try to do the same using api
`````````````````````````````````````````````````````````````````````````````````````````````````````````````````
av_opt_set_int(ofmt_ctx, "hls_list_size", 6, AV_OPT_SEARCH_CHILDREN);
av_opt_set(ofmt_ctx, "hls_flags",
"omit_endlist+append_list+delete_segments", AV_OPT_SEARCH_CHILDREN);
av_opt_set_int(ofmt_ctx, "hls_time", 5, AV_OPT_SEARCH_CHILDREN);
av_opt_set(ofmt_ctx, "master_pl_name", "hls.m3u8",
AV_OPT_SEARCH_CHILDREN);
av_opt_set(ofmt_ctx, "fix_sub_duration", "1", AV_OPT_SEARCH_CHILDREN);
av_opt_set(ofmt_ctx, "var_stream_map", "v:0,a:0,s:0,sgroup:subs",
AV_OPT_SEARCH_CHILDREN);
`````````````````````````````````````````````````````````````````````````````````````````````````````````````````
And I set the sgroup:subs options so that the #EXT-X-MEDIA:TYPE=SUBTITLES
tag is generated in the manifest file, then an error occurs
[hls @ 0x55c4c4b3e580] Invalid keyval sgroup:subtitle
[hls @ 0x55c4c4b3e580] Variant stream info update failed with status
ffffffea
Please tell me how to correctly pass var_stream_map to ofmt_ctx so that
the manifest is created correctly
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11502>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list