xteve-project / xTeVe

M3U Proxy for Plex DVR and Emby Live TV
MIT License
1.86k stars 237 forks source link

xteve is advertising 40000kbps on all streams. #200

Open syadnom opened 3 years ago

syadnom commented 3 years ago

xteve seems to be either advertising a bitrate of 40000kbps or omitting that and allowing other services to see it. Emby and Plex are both reporting this 40000kbps.

Server (please complete the following information):

Expected behavior Some sane number advertised on the streams.

I've used vlc and ffmpeg and get the same result so I suspect this is either in the HDHomerun emulation or just a lack of data and plex & emby are assuming this.

If this worked, I could transcode to hevc in xteve and then all my clients would be direct play from plex. This works if I force the client to 'play original' for example.

syadnom commented 3 years ago

Update, I was incorrect on Emby, Emby is actually handling this well. Plex is apparently assuming that 40000kbps number so I suspect it's just a missing piece of data coming from xteve.

mar-mei commented 3 years ago

xTeVe is only a web server and has no influence on the stream. The buffer only saves the data temporarily and distributes it again via the web server. Metadata or the video container are not changed.

syadnom commented 3 years ago

The stream is fine. Both Plex and Emby see the stream as being 40Mbps though. Maybe that is a default they both use for some missing piece of data from xteve. If I connect directly to the HDHR both Plex and Emby see the bitrate as a sane number (usually 8M). Something is different between the HDHR and xteve data. Note, I have an HDHR Extend that matches the model xteve is claiming to be and I have an HDHR Quadro and they both report the same. Even if I pull the H.264 stream off the Extend through xteve it says 40Mbps.

mar-mei commented 3 years ago

As I said, it's just a web server. xTeVe only tells the client that data is now coming in an unknown size. xTeVe doesn't even know what a video is

syadnom commented 3 years ago

I don't think it's something xteve is doing, I think it's something that is missing.

Can you tell me what Plex requests from xteve? Like the http call it makes? I've dug through a bit and I can't find this . If I could compare what xteve replies to Plex vs what the hdhr does maybe I can find the disconnect.

mar-mei commented 3 years ago

Run:

xteve -debug 3

Maybe that will help with the search

syadnom commented 3 years ago

In lineup.json the HDHR includes "VideoCodec":"MPEG2" while xteve doesn't. (Also AudioCodec)

That seems to be the only significant difference. What are the chances of adding the VideCodec to this reply? and if so, allowing it to be altered in the UI. I'm encoding these to HEVC so I'd want it to match.

I think this is the missing data and plex & emby are just making this 40Mbps assumption because that's a sane maximum for MPEG2.

mar-mei commented 3 years ago

I can't tell you whether that has any effects. xTeVe is also not an HDHomeRun emulator. It only does so much for it to be recognized as a tuner in Plex.

syadnom commented 3 years ago

I don't know if it will but there is some noteworthy difference between an HDHR and what xteve shows that causes this.

syadnom commented 3 years ago

unfortunately Im no good in go and I'm getting tripped up in hdhr.go at getLineup() but I'm stumped on adding a VideoCodec line in there to make lineup.json show that.

any advice for a go newb?

mar-mei commented 3 years ago

strcut-hdhr.go (line 51)

type LineupStream struct {
    GuideName   string `json:"GuideName"`
    GuideNumber string `json:"GuideNumber"`
    URL         string `json:"URL"`
    VideoCodec  string `json:"VideoCodec"`
    AudioCodec  string `json:"AudioCodec"`
}

hdhr.go add this in line 161 :

stream.VideoCodec = "Some video codec"
stream.AudioCodec = "Some audio codec"
realdannys commented 3 years ago

I noticed this too and wondered if it was part of my streaming quality but I don't think it is.

syadnom commented 3 years ago

I wasn't able to get it to build with mar-mei's changes above and test, and haven't had the time to dive it. I'm not a go developer so this is a time consuming and arduous effort to work through for me.

MCTyler commented 3 years ago

I wasn't able to get it to build with mar-mei's changes above and test, and haven't had the time to dive it. I'm not a go developer so this is a time consuming and arduous effort to work through for me.

You might try Hiring someone on Stack Exchange if it's that important.