hls generated with gst (ts m3u8) not playing on safari (but working on chrome)

混江龙づ霸主 提交于 2020-12-15 05:34:42

问题


i'm trying to use gst to generate an hls video from frames within an existing pipeline. once i get the frame as a numpy array i use the following to create the ts and m3u8 file :

            appsrc emit-signals=True do-timestamp=true is-live=True  
            caps={DEFAULT_CAPS}".format(**locals()) !
            "queue" !
            "videoconvert" !
            "x264enc" !
            "mpegtsmux" !
            f"hlssink location={playlist}.%04d.ts " !
            f"playlist-location={playlist}.m3u8"]) 

where default caps = "video/x-raw,format={VIDEO_FORMAT},width={WIDTH},height={HEIGHT},framerate={FPS_STR}".format(**locals())

here's an example of the m3u8 file :

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-TARGETDURATION:15

#EXTINF:15.000000953674316,
20201014_103647.0000.ts
#EXTINF:15.000000953674316,
20201014_103647.0001.ts
#EXTINF:15.000000953674316,
20201014_103647.0002.ts
#EXTINF:7.8000001907348633,
20201014_103647.0003.ts
#EXT-X-ENDLIST

it's playing fine with my ubuntu video player and on chrome but not on safari and firefox. i've tried changing the pipeline a little but nothing worked and don't really know what's the problem. does anyone have any idea ?

following the advice in the comments i tried changing the profile but it didn't change anything. I also found that it adding a silent audio could resolve the problem cause the browser might be expecting that.

EDIT

so the combo audio + profile makes it work but since i'm using appsrc to get the frames i don't know how long the video is gonna be so how can i generate an audio without that information ? thanks


回答1:


So to make it work i set the profile to high and added an audio over the video.



来源:https://stackoverflow.com/questions/64351863/hls-generated-with-gst-ts-m3u8-not-playing-on-safari-but-working-on-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!