[mythtv] trick modes in live tv

Multimedia King multimediaking at yahoo.com
Mon Jun 21 07:35:44 UTC 2010


Dear Robert,

Thanks for the reply.
You mean myth is supporting only scheduling and recording of the streams and is not supporting any trick modes in the live tv? I was under the impression that myth is capable of doing trick modes even in the live tv for N minutes(back and forward) by maintaining ring buffer of live TV.

Please let me know if my above mentioned assumption is wrong. I basically need the logic of creating KeyFrame index and using in ring buffer, I already have key frame generation logic for offline files.

regards,
Mallikarjun


--- On Fri, 6/18/10, Robert Johnston <anaerin at gmail.com> wrote:

From: Robert Johnston <anaerin at gmail.com>
Subject: Re: [mythtv] trick modes in live tv
To: "Development of mythtv" <mythtv-dev at mythtv.org>
Date: Friday, June 18, 2010, 7:44 PM

On 18/06/2010 5:14 AM, Multimedia King wrote:
>   Dear all,
> 
> I am new to Myth-TV but not to PVR implementation.
> Here I am trying to implement time-shift live tv pvr feature in my
> application. I could develop the feature of maintaining the ring buffer
> and pause/play feature in this. I want to implement trick modes(fast
> forward/fast rewind) feature in this model with N minutes. Myth TV
> already does this, but I can't use whole mythtv in my project.
> could you please let me know where should I start tweaking/looking in to
> the code in mythtv project for linux to implement this trickmodes
> feature in Live-TV (time shift for N minutes).

I'm really not sure that this is the best place to ask, but I'll see if I can help with an overview of what I think you need.

Essentially, what you are looking at is a recording model that has been abandoned in MythTV. Myth used to use a ringbuffer system system for live TV, but it has since moved on to full PVR recording from the instant that is asked.

What you need to do is to have 3 threads running. One records TV to a file, one plays back that file (And does fast-forward and rewind), and the last deletes from the end of the file. The deleting thread will only delete data that is x minutes old (adjustable, this is the length of your ringbuffer), but also will not delete beyond the playback point (So if you have the system set up for an hour-long ringbuffer, and someone pauses and walks away for 90 minutes, the playback point isn't deleted).

In theory, you could achieve something like what you want fron a command prompt like this:

cat /dev/video0 | split -b 32 m - Ringbuffer &
echo tmpwatch 1 `pwd` >/etc/cron.hourly
mplayer Ringbuffer*

This would record the input of /dev/video0 to files, splitting every 32mb, and use mplayer to play back those files. The splitting would then make it easier for the hourly cron job to delete stale files. I'm not sure if mplayer will pick up new files that match if they're created after it starts, so that might need to be looked at. But that's essentially the basics of what you need. If you already have a system that handles playback properly (with fast-forward and rewind) then you have everything you need. If you don't, may I suggest you look at the mplayer, ffmpeg or vlc projects, as they all do what you need and are less complicated than Myth.

I hope this helps you some.
_______________________________________________
mythtv-dev mailing list
mythtv-dev at mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mythtv.org/pipermail/mythtv-dev/attachments/20100621/27a3386d/attachment.htm>


More information about the mythtv-dev mailing list