View Full Version : Auto encode some shows for smartphone

2005-03-01, 03:31 PM
I've got my PVR setup working great using GBPVR (thanks sub!), the Media MVP and a PVR350 card and now I want to take it to the next level.

I've got a windows smartphone, and I'd love to be able to create duplicates of certain shows in DivX format at a lower bitrate for playback on the phone.

I can do this manually if necessary, but if anyone can think of a clever way to do this after the show has finished recording I'd very grateful.


2005-03-02, 11:01 AM
I looked into this a little more last night and it seems that windows media encoder 9 comes with a script which allows you to create a batch file for encoding groups of videos. Hopefully this will be the answer - I'll keep you posted on how I get on in case anyone finds it useful...

2005-03-02, 01:46 PM
You *do* know about the PostProcessing.bat file? Anything in that file will be run after each show has been recorded.

2005-03-03, 11:19 PM
OK I've started looking into this and now I'm scared.

So far I have ascertained this:

I need to use a batch file (either postProcessing.bat or my own in conjunction with a Scheduled Task) in order to call a command line divx or xvid encoder with the necessary parameters to encode my show and save it to a different folder.

I've been searching around on Google and have become very confused as to which encoder I should use (AutoGK, Virtual Dub, XMPEG etc) and how I should actually make it work.

So if anyone out there is knowledgeable about this kind of thing I'd be very grateful for any help or advice.


Mr Ming http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

2005-03-04, 02:58 PM
Command line DIVX encoder... ha ha.. that's funny...

I've been doing the same exact thing, and have come to the conclusion that command line divx... naw... not gonna happen.

Best bet is to use AutoGK and the script that was written that'll automate everything via a command line. Example... you'd type like "Transcode 150 show.mpeg show.divx" and it'd pop up the AutoGK windows, and automatically put in the information you've given it, and start the encode... EDIT: Oh yeah.. do a search for AutoGK... you should find the post on here about the script... I believe KingArgyle had talked about it.

I've written a JAVA program that'll take the filename from the postprocessing.bat file and write all the appropriate scripts and then run them... my ONLY problem I ran into is the autoGK script does NOT wait until it's done to give control back to the script... it starts autoGK as a background task... which means... you can't have an option to copy your .divx file where you want after it's done... you gotta encode it where you want it to end up..

Pretty crappy, but that's how it goes... When I'm done with it, I might post a message about it.

2005-03-04, 03:14 PM
I've been using the Windows Media Encoder that will encode to wmv for the smartphone. It can be controlled by command line.

2005-03-04, 03:34 PM
Thank you both for your help.

Rich - would I be able to use AutoGK and a batch file to run a scheduled task on all files in a certain folder?

sub - I had considered the windows media encode script but there's a bit of a problem in that I'd rather use betaplayer on my smartphone than Windows Media Player.

The reason for this is because WM on the Smartphone bizarrely doesn't have any ff/rwd functionality, which would mean having to sit through adverts - not cool.

I could use comskip on the files first I guess but I've heard that it doesn't work that well with programmes recorded from UK tv due to lack of consistency in the screens between adverts.

What media player are you using to play wmv on your smartphone?

2005-03-04, 04:08 PM
I'm not doing anything serious with it, but have tried it out recently to see it work.

I'm just using WMP.

2005-03-04, 05:03 PM
It looks like I might be able to use ffmpeg http://ffmpeg.sourceforge.net/index.php as a command line encoder. One thing I'm not clear on is that you appear to have to pass it a specific filename to encode. How would I go about getting the filename of the show that has just finished - presumably it's not available in PostProcessing.bat?

2005-03-04, 05:17 PM
its the first and only argument passed into the postprocessing.bat file eg for comskip you would use
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">comskip.exe %1[/QUOTE]
note: %n is what dos batch files use to represent arguments (ie the individual tokens you type in at the command line).

2005-03-04, 05:26 PM
Marvellous - thanks reven. I&#39;ll try and get this started over the weekend and I&#39;ll post my results here. Here&#39;s goes nothing *gulp* http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

EDIT - I&#39;ve just realised that (unless I&#39;m missing something) this would result in all my shows getting archived whereas I would like to choose certain key shows. Would it be possible to do a wildcard match on the filename or show title in the PostProcessing.bat to decide whether to archive the show? I&#39;ve never written or edited a batch file before so apologies if this is a) easy, or b) impossible&#33;

2005-03-04, 05:31 PM
i dont think it would be possible with pure batch files, but you could do it with scripts using something like cgywin (i think its the name), just basic unix scripts on a windows machine (ive only ever done this in linux, but i know you can do it in windows).

2005-03-04, 05:56 PM
I have it currently set so it would archive the show after it gets done recording... postprocessing.bat...

I also want to make a file that would go along with my Java program that would let me specify what shows I wanted to have transcoded... so if for instance, &quot;Tilt&quot; recorded and was in the list, it&#39;d get done, but if &quot;American HotRod&quot; was recorded, it woudln&#39;t get transcoded.

That&#39;s just one of those little extra I can add easily, just haven&#39;t gotten to it.

2005-03-04, 08:43 PM
Thanks guys. I&#39;m going to try and use a combination of command line PHP and FFMpeg as I already know PHP and it&#39;s installed on my machine. I&#39;ll let you know how I get on... http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

2005-03-04, 08:46 PM
Where did you find the ffmpeg executeables? I don&#39;t have the patience to download and compile that source code, and everywhere I&#39;ve looked has come up dry...

Windows wise, at least...

2005-03-04, 08:55 PM
http://nic.dnsalias.com/ffmpeg.exe http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

2005-03-04, 09:59 PM
Now if I could only figure out those options... :&#124;

Any hints? :P Simple divx encoding?

2005-03-06, 05:54 PM
Here&#39;s the documentation.


I haven&#39;t had a try yet but the options look pretty hairy alright. I&#39;ll let you know if I have any joy...

2005-03-06, 11:01 PM
OK here&#39;s a call to ffmpeg which will turn an mpeg2 source file into a 186k avi measuring 220x176:

ffmpeg -i g:&#92;temp&#92;test.mpg -b 186 -s 220x176 g:&#92;Temp&#92;test2.avi

2005-03-07, 12:19 AM
I&#39;ve tried to run this several times now, ffmpeg with...

ffmpeg.exe -i test.mpg -f avi -vcodec mpeg4 -s 320x240 -b 1500 ttt.avi

and it gets about 250 frames in, and then crashes hardcore.... this is from an mpeg made from GBPVR... has anyone else run into this so far?

EDIT: Figured it out... it doens&#39;t like it if you skip audio options, if you&#39;ve got audio in your mpeg... Though I can&#39;t get it to do mp3 audio... looks like you have to have it compiled with &quot;LAME&quot; enabled from the start?

2005-03-07, 08:35 AM
I&#39;m trying to use postprocessing.bat to transcode my mpeg recordings to low quality .avi files (quarter pal, 25 frames, 100 kbits/sec).

I have readed in the wiki page about mencoder, and I&#39;ma using it very well. It transcodes for me, but I also try ffmpeg as well. The comand I use (there are different type of output, codecs, and posibilities) is like this:

mencoder -oac mp3lame -lameopts vbr=0:br=64 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=100 -ofps 25 -vf scale=352:288:::::qpal &#036;startmpg -o &#036;outarchive

I also use unix utilities and a sh.exe to execute the script that does this encoding. Maybe can be useful for somebody.

I actually transcode mpeg high quality recordings from terrestrial tv ( 30 minutes - 1,2 Gbytes) to .avi files of 35-40 Mbytes. It works great...