[mythtv-users] ffmpeg convert an ISO to view on PSP - "could not find codec parameters"
dfishburn.mythtv at gmail.com
Sat Sep 15 23:36:47 UTC 2007
> > I use ffmpeg to convert my recording to the PSP.
> > When I attempt to run ffmpeg on an ISO image from a DVD I get:
> > "could not find codec parameters"
I have all of this working now and I would like to:
1. Add it to the wiki, can someone suggest a location.
2. Improve the shell script to automate this a bit more
If anyone has some suggestions on the shell script, shoot them at me, it
will be greatly appreciated.
Some of the improvements I would like to make:
1. Pass in the ISO file, have the shell script automatically mount it (not
sure how to do this since I think it requires sudo rights and I am not sure
how to give those rights to a different user).
2. Make the error checking a bit better:
- This works, but the files might have different names
if [ ! -f "$ISODIR/video_ts/vts_01_1.vob" ];
- What I really wanted to do is check if there are any VOBs
if [ ! -f "$ISODIR/video_ts/*.vob" ];
3. Modprobe loop
- sudo modprobe loop
- Don't know if you have to do this everytime, or can I have the system auto
load the loop module. Not knowing what it actually does, not sure if this
is a good idea or not.
4. Reporting elapsed time.
- I found this code googling around for a bit:
elapsed="$(expr $end -
echo Elapsed seconds for transcode: $elapsed
But that only shows seconds, I wanted to do something like this:
elapsed="$(expr ($end -
echo Elapsed minutes for transcode: $elapsed
But I get expression errors.
In this case I wanted it transcoded for the PSP, but the end result doesn't
matter. It is the mounting of the ISO and the "cat"ing of the VOBs as input
to ffmpeg that was the key to doing it.
Here is the script so far:
echo "pspisoencode called with: $1
# Sanity checking, to make sure everything is in
if [ -z "$ISODIR" -o -z "$ISODIR/video_ts" ];
echo " First mount the
echo " sudo mkdir
echo " sudo modprobe
echo " sudo mount file.iso /media/iso/ -t iso9660 -o
echo " After mounting the appropriate
echo " Usage: $0 <ISODirectory>
#if [ ! -f "$ISODIR/video_ts/*.vob" ];
# if [ ! -f "$ISODIR/video_ts/vts_01_1.vob" ];
# echo "No VOBs exist:
echo "Beginning transcode
# PSP firmware > 3.20 supports a scale of
# Increase the volume from default of 256 to
cat $ISODIR/video_ts/*.vob | ffmpeg -i - -y -acodec aac -ab 96 -vcodec h264
>>kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 480x272 -r 30000/1001 -f
>>lags loop -trellis 2 -partitions
>>evel 13 -vol 500
echo "Ended transcode
elapsed="$(expr $end -
echo Elapsed seconds for transcode:
# elapsed="$(expr $($end -
# echo Elapsed minutes for transcode: $elapsed
Hope it helps someone else.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mythtv-users