LinHES Forums
http://forum.linhes.org/

convert to iPod - mp4ize script, running for MythVideo files
http://forum.linhes.org/viewtopic.php?f=21&t=20648
Page 1 of 1

Author:  langelgjm [ Sun Dec 06, 2009 4:12 pm ]
Post subject:  convert to iPod - mp4ize script, running for MythVideo files

Recently the girlfriend asked me to look into fixing up MythTV to iPod conversion. As far as I can tell, the myth2ipod stuff no longer works out of the box? I looked into fixing it, but it seemed more trouble than it was worth, so instead I've started using a script called mp4ize, which I found here.

I made a few modifications to it, wrote a helper script that allows it to be called as a user job, and it's working well. The best part is that it can be called right from MythWeb, which makes it extremely user (girlfriend) friendly. It spits out iPod-ready video files into a special directory, with names taken from the mythconverg database. However, this solution only works for recordings. Ideally I would like something just as easy to use for my MythVideo files.

I started playing around with MythWeb's video module, and got as far as adding a button beside the standard "Edit" and "IMDB" buttons. But my PHP skills are pretty much non-existent, and I can't seem to figure out how to change the source page of the little frame that those buttons call.

I realize this is more of a MythWeb/PHP question, but there doesn't seem to be a whole lot of documentation on MythWeb. If anyone has any tips or experience in hacking MythWeb, I'd appreciate suggestions.

For reference, I've edited the following file and duplicated an existing function for my purposes:

Code:
/data/srv/httpd/htdocs/mythweb/modules/video/tmpl/default/video.php

    function newWindow(id) {
        $('window_title').innerHTML   = '<?php echo t('Editing '); ?> ' + $(id+'-title').childNodes[0].innerHTML;
        $('window_content').innerHTML = '<iframe src="<?php echo root; ?>video/edit?intid='+id+'">';
        $('window').show();
        Tips.hideAll();
    }

    function iPod_convert(id) {
        $('window_title').innerHTML   = 'Encode ' + $(id+'-title').childNodes[0].innerHTML + ' for iPod';
        $('window_content').innerHTML = '<iframe src="<?php echo root; ?>video/ipod?intid='+id+'">';
        $('window').show();
        Tips.hideAll();
    } 


As you can see, the only substantive change (beside function name) is the iframe src; instead of pointing to the video/edit file, it points to the video/ipod file.

That file is located at /data/srv/httpd/htdocs/mythweb/modules/video/ipod.php, the same directory where the edit.php file is. I know it's the correct edit.php, because if I make a change, I see the change in MythWeb. But for whatever reason, the new frame that pops up when the function is called just displays the default MythWeb video gallery view. My new ipod.php page is never seen.

The eventual plan is to grab the filename of the video from the database, then pass that to mp4ize, perhaps also queuing it up as a user job. Now that I think about it, I suppose I could just forgo opening up the new frame and do the work directly on the video.php page, but I can't for the life of me figure out why the above changes aren't working.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/