[mythtv-users] PDA Transcode: transcode/comm cut for PSP

Peter Watkins peterw at tux.org
Sat Dec 16 05:05:14 UTC 2006


David Fishburn wrote:

>> Peter, I was just reading through your changes to the wiki:
>>
>> ***
>> Then I create a script call "pdatranscode" and put it in 
>> "/usr/local/bin". I have two methods to transcode here. The 

... That, like most of the Wiki page, is Jeff's commentary.

Let me look at your results...

>> I am trying to automatically transcode these shows for a Sony PSP.
>> I was hoping to automatically cut the commericials before I transcode.

> Next I did the following:
> mythtv at myth:~$ mythcommflag --gencutlist --file 1050_20061214153000.mpg

> mythtranscode --infile 1050_20061214153000.mpg --outfile pda/M4V00006.mp4 -l
> -p 29 --showprogress
> 
> And I compared this against my mencoder line:
> mencoder -aid 0 -oac lavc -ovc lavc -of lavf -lavcopts
> aglobal=1:vglobal=1:vcodec=mpeg4:acodec=aac -af lavcresample=24000 -vf
> harddup -lavfopts
> format=psp:i_certify_that_my_video_stream_does_not_use_b_frames -vf
> scale=368:208  -o /media/mythtv/pda/M4V00007.mp4
> /media/mythtv/1050_20061214153000.mpg

Shouldn't the input for mencoder have been pda/M4V00006.mp4, the
output of mythtranscode's removing what's in the cutlist? (I have
*very* little experience trying to do commercial cutting. Having
commercials in the recordings just doesn't bother me that much.)

> Here are the size differences:
> 1,165,664,256 2006-12-14 16:00 1050_20061214153000.mpg
> 840,593,395 2006-12-15 16:56 M4V00006.mp4
> 198,335,598 2006-12-15 17:13 M4V00007.mp4

Here's how to set custom stuff like that up in pdatranscode.pl. In the
"%transcoderCommands" section, you could add lines like these:

A line for only doing a simple transcode:

'psp-transcode-only' => 'mencoder -aid 0 -oac lavc -ovc lavc -of lavf
-lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=aac -af
lavcresample=24000 -vf harddup -lavfopts
format=psp:i_certify_that_my_video_stream_does_not_use_b_frames -vf
scale={scale}  -o {outfile} {infile}',

A line for doing mythcommflag, then mythtranscode to remove the
cutlist, then mencoder to format for the PSP, then rm to clean up the
mythtranscode output:

'psp-cut-and-transcode' => 'mythcommflag --gencutlist --file {infile}
&& mythtranscode --infile {infile} --outfile {outfile}.trimmed.mp4 -l
-p 29 && mencoder -aid 0 -oac lavc -ovc lavc -of lavf -lavcopts
aglobal=1:vglobal=1:vcodec=mpeg4:acodec=aac -af lavcresample=24000 -vf
harddup -lavfopts
format=psp:i_certify_that_my_video_stream_does_not_use_b_frames -vf
scale={scale} -o {outfile} {outfile}.trimmed.mp4 && rm
{outfile}.trimmed.mp4',

Then you should be able to transcode the file with something like the
following -- be sure you're logged in as the user that mythbackend
runs as:

pdatranscode.pl --transcoder psp-transcode-only --file
1050_20061214153000.mpg --scale 368:208 --filename-format
"{title:12}-{month}-{day}-{subtitle:15}-{hour}{minute}.mp4" --title
"just testing"

if that works & I'm understanding the commflag/transcode/mencoder part
correctly, you should be able to remove commercials & transcode with

pdatranscode.pl --transcoder psp-cut-and-transcode --file
1050_20061214153000.mpg --scale 368:208 --filename-format
"{title:12}-{month}-{day}-{subtitle:15}-{hour}{minute}.mp4" --title "
testing cut and transcode"

and if that works, you could install a User Job with a command like

pdatranscode.pl --transcoder psp-cut-and-transcode --scale 368:208
--filename-format
"{title:12}-{month}-{day}-{subtitle:15}-{hour}{minute}.mp4"
--install-job-number 1 --install-job-name "Transcode for PSP"

plus entering the mysql password when prompted & restarting
mythbackend (at least I have to with my 0.19 backend) to pick up the
database changes.

Run
  pdatranscode.pl --help filename-format
if you want more information on how to customize the output filename.

Is that 368:208 scale right? Most of my recordings are 4:3 aspect
ratio, so the scales I use are 4:3 ratios. I use 480:360 for letterbox
content (my Palm can display 480:320), and 428:320 for standard 4:3
content. This gives me the best sizing, and lets the TCPMP playback
software display at 100% pixel size for lower CPU/battery usage and
better performance. I would expect that the 16:9 ratio of 368:208
would likely stretch your 4:3 content horizontally. I know some people
like that, and do things like have their widescreen TVs stretch 4:3
content into 16:9, but not I. :-)

-Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: OpenPGP digital signature
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20061216/c935b21b/attachment.pgp 


More information about the mythtv-users mailing list