streamlink: PlutoTV stops streaming when switching to a commercial
Bug Report
- [x ] This is a bug report and I have read the contribution guidelines.
- I am using the latest development version from the master branch.
Description
Streaming stops whenever plutoTV switches to a local commercial. I have seen this on various pluto news channels such as NEWSY and Newsmax. After a news segment, the channel will switch to local commercial and a message from pluto states that they will be right back - but the stream hangs at that point, never to return unless, the stream is restarted.
Expected / Actual behavior
I expect that if the channel switches segments that the stream will continue to play as normal, but it does not do this, the stream stops
Reproduction steps / Explicit stream URLs to test
- …Tune to plutotv- Newsy and watch for 5-10 minutes until the segment changes
- …for me at the change, streaming stops
- …
Log output
REPLACE THIS TEXT WITH THE LOG OUTPUT
Additional comments, etc.
Love Streamlink? Please consider supporting our collective. Thanks!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 28 (14 by maintainers)
Thank you @mkbloke for improving the handling of adverts by the plugin. Sending the output to a file results in a good “recording” but it is still necessary to run
ffmpeg -c copyover that file in order to fix the timestamps.so far, i have not found another candidate for filtering segments. VoD i am not using. So, i am of no help here.
mainly i want you to know, that i wanted to donate some money. unfortunately i was ask to full fill a captcha(s). i guess it’s because my notebook, i am currently writing from, goes per default to VPN Frankfurt Germany.
i wrote support support@opencollective.com that i find it annoying and that i am not doing it. also, going into my FW and disabling some rules i don’t like, but may you guys find a provider without this obstacles.
This was more a general comment, since any application using this strategy for Live TV playback from PlutoTV vs recording playback will probably have a difficult time dealing with potential long periods of no video.
I posted about MTV Spankin’ New earlier and see noticeable improvements in the test release with streamlink cli and with recordings and when the logo comes up which was sudden death before things get better. For Live TV in NextPVR the long pause is still an issue.
Unrelated to this be aware there is a v4 VOD format that has been used for a few months for series and AFAIK streamlink doesn’t support it.
thx @mkbloke,
with your patch applied i zapped through the pluto.tv channels.
content coming from pluto.tv cdn show no DTS discontinuities. Players like vlc, totem or mpv stop playback on streamlink output halt/pause. tvheadend reconnects and resumes.
with $>streamlink -o “filename” recorded/saved streams play the content without the ads.
CBSN channels are different. The content is from cbsn cdn, the ads are from dai.google.com. i.e. CBSN New York:
the ads play in tvheadend with stutter audio and no/black video and finally tvh reconnets.
vlc, totem and mpv while playing back such recorded stream jump over this part. i saw the video playback progress bar jumping.
when the ads end tvheadend reports:
overall, playback over tvheadend does not come into complete disorder as before!
that are my findings so far. i keep on zapping and let you know 😃
Since I haven’t commented on this thread yet, let just quickly say that HLS discontinuities are not supported by Streamlink. The only workaround is filtering out segments from the other stream(s) after a discontinuity (eg. advertisements), similar to what other plugins are doing, but that will still leave a gap in the output. The discontinuities are a bigger problem in the plugin here compared to other plugins, because the output is a
MuxedStreamand not anHLSStream, so FFmpeg will complain when the unfiltered output gets read and a discontinuity occurs.Why does the PlutoTV plugin even output
MuxedStreams instead ofHLSStreams? It even setsffmpeg-fouttompegts, which doesn’t have any effect if the HLS stream is already an mpegts stream, which is the case because fragmented mp4 HLS streams were only implemented by me a few months ago (the second type of HLS stream formats), more than half a year later compared to when the plugin was added, so only mpegts streams were supported at that time anyway. https://github.com/streamlink/streamlink/pull/3363#issue-751038758 https://github.com/streamlink/streamlink/blob/3.0.3/src/streamlink/plugins/pluto.py#L94-L96@mkbloke, HLS segments should not be filtered out via the
HLSStreamWriter.ignore_namesregex. This is the old “hacky” way that was implemented before I’ve implemented an actual filtering mechanic and it is only kept for backwards compatiblity or usage via CLI parameters. The entire init method should also not be re-implemented, because otherwise it will introduce bugs later one when the parent class gets updated.If you want to filter out HLS segments properly, then use the
HLSStreamWriter.should_filter_sequence()method. Take a look at the Twitch plugin on how to do this. There are also lots of tests for this.