I'm new to gstreamer. I want to realize an iOS app to play hls videos by gstreamer. I use the version 1.6.2. I followed some tutorials on the internet so I got the following pipeline:
souphttpsrc location=some_m3u8_url ! hlsdemux ! tsdemux name=mux mux. ! queue ! h264parse ! avdec_h264 ! autovideosink mux. ! queue ! aacparse ! faad ! autoaudiosink
I found some hls video urls to test but strangely, it partially worked.
Sometimes it plays the video during several seconds and then it stops and it gives: Error received from element hlsdemux0: Internal data stream error.
Sometimes it dose not play the video but just shows the first frame of this video.
I also tried playbin
and decodebin
, but they didn't work. Error message like:
Buffering 4%
Buffering 8%
Error received from element hlsdemux0: GStreamer encountered a general stream error
This kind of error made me upset for weeks and I could not find any help. Further more, what I need is to also play the encrypted video, but I have no idea if this function is integrated or not.
Hope someone can help me or give me some suggestions. Thanks a lot!
PS: Dev environment: Xcode 7.3, iOS 9.3.1 (ipad).
I have found the solution several months ago and it worked perfectly. So I post it in case someone need.
souphttpsrc name=src ! hlsdemux ! tsdemux name=u u. ! queue ! h264parse ! avdec_h264 ! autovideosink u. ! queue ! aacparse ! faad ! audioconvert ! audioresample ! autoaudiosink
Of course you can use playbin or uridecodebin for those who have not many needs of customizing.