sunsettrack4 / telerising

This version of Telerising will no longer be maintained.
https://telerising.de
GNU General Public License v3.0
42 stars 17 forks source link

Use -re ffmpeg option to use native frame rate for live streams #13

Open nikdom opened 4 years ago

nikdom commented 4 years ago

Hi,

I am using Telerising API in a Tvheadend. I always had the problem that the stream was stuttering over wifi in the beginning, after a minute or two it worked fine, but still every other 5 minutes a small stutter came up. However, via ethernet everything worked fine after a little stuttering in the beginning.

After some research I found this which points to the -re option of ffmpeg. It forces to use the native frame rate, which makes sense for live streaming. In my opinion every stream via Telerising (live tv, or even zattoo on demand) are kind of live streams.

Thus, to test, I forked Telerising, added the -re to all ffmpeg pipes in this commit, and it works perfectly.

Why am I not doing a Pull request? I only have zattoo as source available + Tvheadend is my only client. I don't know if it makes sense for all clients. I would assume so, but I am not sure.

Please let me know, if you think, it makes sense for all, I can create a PR, otherwise I would be happy to see it at least for zattoo as either a default option or a configurable option for ffmpeg pipes.

nikdom commented 4 years ago

In tvheadend subscriptions I can see the result as well. There is a consistent input/output kb/s. Previously, without -re, it was peaking to some high value, and going down to 0 again. Back at 0, the stuttering was starting since the client buffers were most likely empty.

gregor-hh commented 4 years ago

sounds very good, I realised that also with the kb/s rate, that its not constant.

EDIT: works perfect with Wilmaa!!! I have edited manually the tvheadend mux with -re.

constant bitrate now and no drops at the beginning. TOP TOP TOP!!! @sunsettrack4 pls add 👍👍

nikdom commented 3 years ago

@sunsettrack4 do you think it makes sense? for me tvheadend as client is not usable without the change. If you think it makes sense, i would create a PR. No need to keep my fork alive just for this.

omski commented 3 years ago

Habe es mit 1und1.tv getestet es läuft wunderbar.

matthias1232 commented 3 years ago

@sunsettrack4 It works for me too. Its much better to have a constantly bitrate than a big Package and a break every time. Now my streams dont get stuck as often as before.

Can you please add it? Maybe with a Userfile.json Value to give it as an optional Setting

m-a-v commented 3 years ago

I have added the following lines to my custom made Dockerfile.

RUN /bin/sed -i 's/ffmpeglib \-i/ffmpeglib \-re \-i/g' <replace_with_correct_path>/zattoo.pl
RUN /bin/sed -i 's/ffmpeglib \-loglevel fatal \-i/ffmpeglib \-loglevel fatal \-re \-i/g' <replace_with_correct_path>/zattoo.pl