gpac / gpac

GPAC Ultramedia OSS for Video Streaming & Next-Gen Multimedia Transcoding, Packaging & Delivery

Home Page:https://gpac.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

noinitraw flag doesn't remove the #EXT-X-MAP:URI tag in the subtitles playlist when rawsub=true for HLS

estigma88 opened this issue · comments

Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

Trying the following GPAC command to generate CMAF2 HLS with raw subtitles (rawsub) is creating a m3u8 playlist with an init file, which GPAC doesn't create:

gpac  \
  -i output.ts \
  -i subtitle.vtt \
  -o res/live.m3u8:cmaf=cmf2:rawsub=true:segdur=1:cat=auto

We set the rawsub=true, which works fine, however, the following is the subtitles playlist generated:

#EXTM3U
#EXT-X-TARGETDURATION:1
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MAP:URI="subtitle_dashinit.vtt"
#EXTINF:1,
subtitle_dash1.vtt
#EXTINF:1,
subtitle_dash2.vtt
#EXTINF:1,
subtitle_dash3.vtt
#EXTINF:1,
subtitle_dash4.vtt
#EXTINF:1,
subtitle_dash5.vtt
#EXTINF:1,
subtitle_dash6.vtt
#EXTINF:1,
subtitle_dash7.vtt
#EXTINF:1,
subtitle_dash8.vtt
#EXTINF:1,
subtitle_dash9.vtt
#EXTINF:1,
subtitle_dash10.vtt
#EXTINF:1,
subtitle_dash11.vtt
#EXTINF:1,
subtitle_dash12.vtt
#EXTINF:1,
subtitle_dash13.vtt
#EXTINF:1,
subtitle_dash14.vtt
#EXTINF:1,
subtitle_dash15.vtt
#EXTINF:1,
subtitle_dash16.vtt
#EXTINF:1,
subtitle_dash17.vtt
#EXTINF:1,
subtitle_dash18.vtt
#EXTINF:1,
subtitle_dash19.vtt
#EXTINF:1,
subtitle_dash20.vtt

#EXT-X-ENDLIST

Look to the tag #EXT-X-MAP:URI="subtitle_dashinit.vtt", but the subtitle_dashinit.vtt file is not created, so, when we play the HLS VOD, subtitles don't show up.

The following is the filter graph of that command:

Filters connected:
fin (src=output.ts) (idx=1)
-(PID output.ts) m2tsdmx (dyn_idx=4)
--(PID P1V2) rfnalu (dyn_idx=6)
---(PID P1V2) dasher (dyn_idx=8)
----(PID manifest_m3u8) fout (dst=res/live.m3u8:cmaf=cmf2:rawsub=true:segdur=1:cat=auto) (idx=3)
----(PID subtitle.vtt)  ufvtt (dyn_idx=12)
-----(PID subtitle.vtt) writegen (dyn_idx=13)
------(PID subtitle.vtt) fout (dst=res/subtitle_dashinit.vtt:gfopt:cmaf=cmf2:rawsub=true:segdur=1:cat=auto:noinitraw:frag:xps_inband=no:psshs=moov:cmaf=cmf2) (idx=9)
----(PID P1V2)          mp4mx (dyn_idx=14)
-----(PID P1V2) fout (dst=res/output_dash_track256_init.mp4:gfopt:cmaf=cmf2:rawsub=true:segdur=1:cat=auto:frag:xps_inband=no:psshs=moov:mime=video/mp4:cmaf=cmf2) (idx=10)
----(PID P1A3)          mp4mx (dyn_idx=15)
-----(PID P1A3) fout (dst=res/output_dash_track257_init.mp4:gfopt:cmaf=cmf2:rawsub=true:segdur=1:cat=auto:frag:xps_inband=no:psshs=moov:mime=audio/mp4:cmaf=cmf2) (idx=11)
--(PID P1A3) rfadts (dyn_idx=7)
---(PID P1A3) dasher (dyn_idx=8)
fin (src=subtitle.vtt) (idx=2)
-(PID subtitle.vtt) txtin (dyn_idx=5)

Note in the line fout (dst=res/subtitle_dashinit.vtt:gfopt:cmaf=cmf2:rawsub=true:segdur=1:cat=auto:noinitraw:frag:xps_inband=no:psshs=moov:cmaf=cmf2) (idx=9) how the flag noinitraw tells the dst to not generate an init file.

Seems like GPAC shouldn't add the #EXT-X-MAP:URI to the subtitles playlist if noinitraw flag is there?

The following are the attachments to run the GPAC command:

Thanks for the report, now fixed