0

I try to record m3u8 stream containing audio only. It is online radio but listening is geographicaly restricted and in my country requests fails with HTTP 403 but on server in (non-restricted) remote country stream work. As an workaround I bought server in that country and setup TCP forwarding using socat:

sudo socat TCP-LISTEN:80,fork,reuseaddr tcp:server-with-radio-stream.com:80

And in hosts file on my local server I fixed DNS mapping of server-with-radio-stream.com to IP address of my forwarding server instead of original server.

This works and I can record radio stream on my local server but have it one caveat which I do not understand: Stop time in both VLC and ffmpeg do not work. If I run follwoing commands directly on server in non-restricted country, stop-time work and stream recording terminates in about 100 seconds but when I run it localy (using socat forwarded stream), in case of VLC it terminates recording early (in about 15 seconds) and in case of FFMPEG it records endlesly. I use following two CLI commands:

cvlc "http://server-with-radio-stream.com/.../xxxx.m3u8" --sout="#transcode{acodec=mp3,channels=2}:standard{access=file{append},mux=mp3,dst='xxxx.mp3'}" --run-time=100 vlc://quit

and

ffmpeg -t 100 -i "http://server-with-radio-stream.com/.../xxxx.m3u8" -c copy output.mkv

In fact I originaly used VLC only, but for eliminating bug in VLC I tried alternative (ffmpeg) and suprisingly alternative is also affected by this issue.

Why do forwarding stream break timestamping of VLC and FFMPEG and how can I fix it in native way instead of bypassing broken functionality by implementing stopping mechanism manually using sending termination signal?

0

You must log in to answer this question.

Browse other questions tagged .