[mythtv] Live transcode while recording

Chase Douglas chasedouglas.lists at gmail.com
Tue Dec 2 14:29:10 UTC 2008


On Dec 2, 2008, at 8:12 AM, Jonny B wrote:
> Sorry, I guess I misunderstood the problem. In the message I was
> replying to, he merely stated that he wanted a way to stream live tv
> and recordings over the internet. He stated that he wasn't concerned
> about the client, based on that, how is the flash portion of mythweb
> NOT a way for him to reach his objective? It seemed to me to be the
> ideal solution, if stable.

Most mobile devices cannot play flash video. A universal solution  
requires the ability to transcode on the fly to whatever format is  
needed by the client requesting the stream.

> I am not a dev, so am not as familiar with the code as many of you,
> and sometimes all I have is conjecture. What about the way that bttv
> cards record? Those are encoding on the fly as they record, in
> software... is there any way to implement that into the transcoder?

Yes, mythbackend already has transcoding and this should be just a  
matter of ripping up portions of code from one area and reimplementing  
them in another.

> If possible, you could have it record the show off a HD card, and
> write the stream to disk, as myth currently does, but in parallel, you
> could pipe the file to the transcoder to save it in a second format
> for low def frontends and internet streaming. The original recording
> would act as a buffer, so that if your CPU wasn't up to doing it in
> realtime, that wouldn't be an issue.  As a bonus, people could
> continue to use their older TVs (in the basement, or kids room?) with
> low powered frontends, and still have the high definition recording
> available for the more powerful frontends. You would likely need to
> add a setting in the frontend that tells the backend which version of
> the file you wished to use.

That helps but doesn't really solve the problem. At that point, you  
have the file existing on your HD in two different formats consuming  
extra space. Also, if you have multiple clients requiring different  
formats you would need to transcode into each separate format. The  
better solution is to wait until the client says it wants a video  
streamed in a certain format. When the recording or livetv is recorded  
to disk, it is only recorded in the normal mythbackend format.  
However, instead of shuffling that stream out to the client, the  
stream would transcoded first.

The difference is that you are putting off the transcoding to "watch"  
time instead of "record" time, which results in less disk space used  
and potentially less processing if you don't actually watch every  
recording or livetv stream using the different format. The downside is  
that if you watch a stream twice transcoding on the fly to the same  
codec, then you will have transcoded the same video twice, which uses  
more processing time. However, the normal usage scenario would be that  
you watch a recording once and then you probably don't watch it again.


More information about the mythtv-dev mailing list