Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks stream when midroll ads appear #11

Open
instance01 opened this issue Mar 17, 2019 · 3 comments
Open

Breaks stream when midroll ads appear #11

instance01 opened this issue Mar 17, 2019 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@instance01
Copy link
Owner

instance01 commented Mar 17, 2019

See #10.

I have a tough time actually getting a midroll ad to debug this. It'd a great help if someone encounters such an ad and could attach debug output as described in #8 by @stoically.

@instance01 instance01 added bug Something isn't working help wanted Extra attention is needed labels Mar 17, 2019
instance01 added a commit that referenced this issue Mar 18, 2019
Fix stream breaking when there's only ads and no underlying stream to
show, resulting in the extension filtering too much #11.
Fix sequence numbers not being reset correctly for midroll ads.
Add explanatory comments.
@instance01
Copy link
Owner Author

This is most likely fixed with 6dc974a, but preroll ads need testing now.

@stoically
Copy link
Contributor

stoically commented Mar 20, 2019

Did some digging and here are my results for a midroll:

Last non-Ad .ts segment

  • Request time: "Tue, 19 Mar 2019 12:04:39 GMT"
  • m3u8 value: #EXT-X-PROGRAM-DATE-TIME:2019-03-19T12:04:36.892Z

First ad .ts segment

  • Request time: "Tue, 19 Mar 2019 12:04:41 GMT"
  • m3u8 value: #EXT-X-PROGRAM-DATE-TIME:2019-03-19T12:04:38.892Z

First non-Ad .ts segment

  • Request time: "Tue, 19 Mar 2019 12:05:21 GMT"
  • #EXT-X-PROGRAM-DATE-TIME:2019-03-19T12:05:18.892Z

So it seems there's actually a 42s gap without non-Ad segments. Here's the raw HAR with sensitive values replaced.

I've tried to inject a .ts replacement video for the ad segments, generated with

ffmpeg -f lavfi -i color=c=black:s=1920x1080:d=2 -c:v h264 -vf "drawtext=fontfile=/usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf:fontsize=60: fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2:text='Blocking Ads. Stay tuned.'" output.ts

but the player doesn't seem to like that.

Btw, I just noticed that the initial request to https://usher.ttvnw.net/api/channel/hls/<channelname>.m3u8, which serves the urls to the first playlists for the different encodings, has a parameter called show_ads which is set to true. Might be worth trying to rewrite that one to false. 😆

@stoically
Copy link
Contributor

Here's a gist of what I've tried so far regarding injecting the generated ts segment using the webrequest API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants