[mythtv-users] ffmpeg convert an ISO to view on PSP - "could not find codec parameters"

David Fishburn 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" ];
then

   - What I really wanted to do is check if there are any VOBs
if [ ! -f "$ISODIR/video_ts/*.vob" ];
then


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:
start="$(date +%s)"
end="$(date +%s)"
elapsed="$(expr $end -
$start)"
echo Elapsed seconds for transcode: $elapsed

But that only shows seconds, I wanted to do something like this:
    elapsed="$(expr ($end -
$start)/60)"
    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:
*******************
#!/bin/sh

ISODIR=$1

TITLE=$2

RSSDIR="/media/mythtv/rss"

OUTFILENAME=${RSSDIR}/${TITLE}.MP4



echo "pspisoencode called with: $1
$2"
# Sanity checking, to make sure everything is in
order.
if [ -z "$ISODIR" -o -z "$ISODIR/video_ts" ];
then
        echo "Usage:
"
        echo "    First mount the
ISO"
        echo "        sudo mkdir
/media/iso"
        echo "        sudo modprobe
loop"
        echo "        sudo mount file.iso /media/iso/ -t iso9660 -o
loop"
        echo "    After mounting the appropriate
ISO:"
        echo "        Usage: $0 <ISODirectory>
<OutFileName>"
        exit
5
fi

#if [ ! -f "$ISODIR/video_ts/*.vob" ];
then
# if [ ! -f "$ISODIR/video_ts/vts_01_1.vob" ];
then
#         echo "No VOBs exist:
$ISODIR/video_ts"
#         exit
6
#
fi



echo "Beginning transcode
at:$(date)"
start="$(date +%s)"
# PSP firmware > 3.20 supports a scale of
480x272
# Increase the volume from default of 256 to
480
cat $ISODIR/video_ts/*.vob | ffmpeg -i - -y -acodec aac -ab 96 -vcodec h264
-b 280
>>kb -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 480x272 -r 30000/1001 -f
psp -f
>>lags loop -trellis 2 -partitions
parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -l
>>evel 13 -vol 500
"${OUTFILENAME}"


end="$(date
+%s)"
echo "Ended transcode
at:$(date)"


elapsed="$(expr $end -
$start)"
echo Elapsed seconds for transcode:
$elapsed
# elapsed="$(expr $($end -
$start)/60)"
# echo Elapsed minutes for transcode: $elapsed

*******************

Hope it helps someone else.
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070915/1efc7769/attachment.htm 


More information about the mythtv-users mailing list