Generating MP4 from HLS stream

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Generating MP4 from HLS stream

gugovind
Hi,
I am trying to generate MP4s from HLS streams with discontinuity tags. Since
the videos are from the same source the FPS and the WXH are the same.

I tested with the following pipeline to demux and play it and it works fine
gst-launch-1.0 -v souphttpsrc
location=https://b.fssta.com/hm-api/manifest/index.m3u8\?video_host\=b.fssta.com\&content_filter\=%7B%22player%22:%5B115685%5D%7D\&business_rules\=fox_world_cup\&asset_filter\=%7B%22year%22:%5B2018%5D%7D\&pkg_level\=720
! hlsdemux ! decodebin name=decoder ! queue ! autovideosink decoder. ! queue
! autoaudiosink

To this I added the x264 enc and avenc_aac encoder to save it to a file and
it keeps failing on "gstadaptivedemux.c(2651): _src_chain ():
/GstPipeline:pipeline0/GstHLSDemux:hlsdemux0"

gst-launch-1.0 -v  mp4mux name=mux faststart=true presentation-time=true !
filesink location=dipoza.mp4 souphttpsrc
location=https://b.fssta.com/hm-api/manifest/index.m3u8\?video_host\=b.fssta.com\&content_filter\=%7B%22player%22:%5B115685%5D%7D\&business_rules\=fox_world_cup\&asset_filter\=%7B%22year%22:%5B2018%5D%7D\&pkg_level\=720
! hlsdemux ! decodebin name=decoder ! queue name=q1 ! videoconvert ! queue
name=q2 ! x264enc name=encoder ! mux.  decoder. ! queue name=q3 !
audioconvert ! queue name=q4 ! avenc_aac ! mux.

Please let me know what I am doing wrong here.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Generating MP4 from HLS stream

gugovind
After a lot of debugging, I found the issue with my pipeline. I had to use
voaacenc encoder instead of avenc_aac encoder

voaacenc is not installed by default in gst-plugins-bad for mac. I so I had
to use

brew reinstall gst-plugins-bad --with-libvo-aacenc

The following pipeline worked well with my application.

gst-launch-1.0 --gst-debug=3 mp4mux name=mux ! \
 filesink location=xxxx.mp4 souphttpsrc location=<hls url> ! decodebin
name=decode  ! \
 videoconvert ! videorate ! video/x-raw, framerate=50/1 ! queue ! x264enc !
mux. decode. ! \
 audioconvert ! voaacenc ! mux.
Also in my HLS stream video segments some had 50FPS and some had 59.97FPS.
So I used a videorate to default to 50. This might need to change depending
on your segments



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel