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

Add back the MPEGTS over HTTP streaming functionality with some extensions #71

Closed
wants to merge 4 commits into from

Conversation

perexg
Copy link
Contributor

@perexg perexg commented Mar 8, 2012

  • for service, allow MPEGTS streaming with PAT/PMT tables
  • optimize the loop mutex locking inside http_stream_run()

…sions

- for service, allow MPEGTS streaming with PAT/PMT tables
- optimize the loop mutex locking inside http_stream_run()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
@EricV
Copy link
Contributor

EricV commented Mar 8, 2012

I added it my tree as I'm not satisfied with the mkv http streaming either. Works => thanks

mkv streaming does not work with mplayer2 or vlc 2 while ts streaming works. I have a comment. instead of play/MTS why did you not enhance the play menu and alway have a default as when is no VLC plugin, it already propose different method (direct url, m3U, or local window as when the plugin is found).

This saves about 30-40% of the CPU for MPEG-TS streaming (less thread wakeups
and locking, optimized write() calls).

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Do not stop stream when an reconfigured event occurs.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
@EricV
Copy link
Contributor

EricV commented Apr 5, 2012

The optimization part breaks ts recoding in my branch git://github.com/EricV/tvheadend.git

@perexg
Copy link
Contributor Author

perexg commented Apr 10, 2012

My extpull-tsrec branch solves the ts recording clashes.

https://github.com/perexg/tvheadend/tree/extpull-tsrec

@EricV
Copy link
Contributor

EricV commented Apr 10, 2012

Le 10/04/2012 10:45, perexg a écrit :

My extpull-tsrec branch solves the ts recording clashes.

https://github.com/perexg/tvheadend/tree/extpull-tsrec


Reply to this email directly or view it on GitHub:
https://github.com/andoma/tvheadend/pull/71#issuecomment-5041438

Thanks. Will have a look when back from vacation. I think the clone
flags was misued for the TS recording...

--eric

@EricV
Copy link
Contributor

EricV commented Apr 13, 2012

I tested your branch and indeed it was working=> thanks.

Can I abuse and ask what the latest patch fix the MTS reconfigure event" is supposed to cover and why mkv is not affected?

@john-tornblom
Copy link
Contributor

If anyone is interested, initial support for libavformat is available at:
https://github.com/john-tornblom/tvheadend/tree/lav_http_muxing

What this means is that the stream is remuxed to either matroska or mpegts, while still allowing modifications to the stream (like pid filtering, image manipulation, transcoding, tagging and so on).

to choose between muxers, either do:
mplayer http://localhost:9981/stream/channel/ChannelName?mux=mpegts
or
mplayer http://localhost:9981/stream/channel/ChannelName?mux=matroska

the libav dependency is optional and can be replaced with the built-in matroska muxer during compile time.

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

The problem is not to have it in a tree. There are at least 4 trees that have TS support for both streaming and recording. Either its important for end users or not. If it is it should be mainstream. If not who cares...

@john-tornblom
Copy link
Contributor

EricV, if it is going to end up in the main tree, it needs to be tested by people, don't you agree?

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

My tree (and not my code) has been well tested ;-)

@john-tornblom
Copy link
Contributor

EricV, I'm very well aware of the TS HTTP streaming code in your branch (I wrote the initial starting point).
If you aren't interested in my attempt to include TS support in tvheadend, you are free to ignore my request for help.

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

For someone that did the commit removing TS streaming this sound quite a curious statement. And your tree lacks TS recording that people use and like for time shifting/watch and record. Waiting to know where tvheadend is heading...

@john-tornblom
Copy link
Contributor

EricV, What is it you find curious about that statement?

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

You pretend you want to add back TS streaming support while you explicitly removed it at the first place. FInd that curious BYMMV.

@john-tornblom
Copy link
Contributor

EricV, What makes you think I'm pretending?

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

I tend to trust facts better than statement I guess. Facts proves you removed it. Statement is currently that you want to add it back. I will fully believe you when I will see TS streaming and recording back upstream.

The more changes you and adam commit mainstream, the more complicated reintegration may be. I certainly would have merged pending pull request BEFORE starting modification unless you want to make architectural change first. But in the mean time, fact is, users currently have no mainstream TS support.

@john-tornblom
Copy link
Contributor

Facts also prove I added initial TS support (under a different nick though since this was during the svn days, but still my work).

729a645

That gotta count for something?

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

In fact you primarily added streaming (that's clear in the changelog). And yes streaming is a nice feature! Streaming TS was simpler because you had no mkv remux to do. Then you removed TS streaming in favor of MKV streaming. Why?

As explained, for me, there is no technical advantages of MKV streaming over TS when source is TS in general plus TS->MKV remux using tvheadend code is far from perfect (of course using ffmpeg remuxing is far better but also more costly in term of code size, dependency and CPU cycles. I doubt for example many NAS have libav ported).

@john-tornblom
Copy link
Contributor

EricV, don't you think the plugin-like system I wrote yesterday would allow you to pass through the raw source as well? That would give you the option to use either libav, builtin mkv or raw source.

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

Raw is the complete mux containing several TS for me. If by raw, you mean already remuxed TS, then yes it may be convenient. The question remain whether anybody will stand up to provide ready to go code that streams and record in TS in this new architecture. If you provide only the plugin system upstream and do nothing else, you make it even more complicated for user to add back TS as now there are trees and binary packages that juts do it.

@john-tornblom
Copy link
Contributor

EricV, this pull request is regarding HTTP streaming. If you would like to discuss recording to disk, you should do so elsewhere.

Regarding the mpegts pass through feature I initially added to the http server, the same thing will eventually end up inside my little plugin-system. I just haven't gotten around doing it yet.

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

There are other PR for that namely ekass one. This one was just becaise you removed TS streaming Support. People wanting TS wants both (recording AND streaming). Why should I comment elsewhere. I just warm people that your plugin architecture will not provide TS recording and frankly speaking I do not think you really care adding it. .For records, It still thinks DLNA is better suited to perform transcoding. Unless you provide it, I still think you do not really care about TS and worse that adding the plugin subsystem will complicate enduser life until someones takes the time to readd TS.

And BTW, the actual mainstream code does not handle EAC3 correctly meaning HD recording and streaming in whatever format would be broken in France.

@john-tornblom
Copy link
Contributor

Again, this topic is about HTTP streaming.

There are perfectly good bug reports for TS recording, EAC3, DLNA and so on.

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

Its not about HTTP streaming in general its about TS streaming via HTTP. So saying your tree provides an alternative is somewhat misleading to say the least. And as adam stated you do not care about TS, I just wanted to put things back at their place.

Commit TS streaming in your tree first using internal tvheadend muxer and then I will let you say it is an alternative.

@john-tornblom
Copy link
Contributor

@EricV
I'm sure that if you would take the time to actually look at the code you'd see that you are the one misleading people.

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

You wrote : "Regarding the mpegts pass through feature I initially added to the http server, the same thing will eventually end up inside my little plugin-system. I just haven't gotten around doing it yet."

I see fixes that popped up just few minutes ago...

@john-tornblom
Copy link
Contributor

Anyhow, if anyone else is interested in trying out my branch, feedback is appreciated.

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

Will do when back home. No DVB hardware ATM. Side question what are the plan and timing for merging this code?

@john-tornblom
Copy link
Contributor

The timeplan is as with many other open source projects, when its ready :)

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

End users badly needing TS will appreciate the precision :-) This makes me question where now should someone add back TS streaming and recording support? In your tree, in the main tree?

@adamsutton
Copy link
Contributor

Eric there is no need to add the support back in, John is already adding the support. He has, in my opinion, created a very neat framework for handling this. He started with WEB streaming as that was probably easiest place for him to test etc...

I would hazard a guess he's got at least a week or so to clean up the code and test stuff etc... And I'm sure he'd really appreciate any feedback on the performance of his fork.

@EricV
Copy link
Contributor

EricV commented Aug 3, 2012

OK. Will wait then. But currently no TS recording and some bug fixes (EAC3, PAT/PMT periodic generation) and optimization for streaming missing currently AFAIKT.

@ghost ghost assigned john-tornblom Aug 16, 2012
@john-tornblom
Copy link
Contributor

Most of the things have been merged with upstream now, including some of the optimizations. I did some benchmarks on my router and it seems to run pretty smooth. If something is missing, please file a bug report on redmine and I'll see what we can do about it.

@perexg perexg deleted the fixes-stream-ts branch March 9, 2014 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants