LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   ffmpeg psp encoding woes (with a solution!) (https://www.linuxquestions.org/questions/linux-software-2/ffmpeg-psp-encoding-woes-with-a-solution-619247/)

allstarzero 02-06-2008 11:41 PM

ffmpeg psp encoding woes (with a solution!)
 
I recently decided I wanted to encode a few videos off of my computer to watch on my PSP. I'd done this successfully a few years back, but I didn't really remember what I had done. So to begin with, my starting point was this website.

If you scroll down to the section entitled Using ffmpeg to Transcode Videos, you'll see the following command line entry:

Code:

ffmpeg -y -i cnn.mpg -title "cnn" -timestamp "2005-04-08 03:12:36" -bitexact -vcodec
xvid -s 320x240 -r 29.97 -b 1500 -acodec aac -ac 2 -ar 24000 -ab 64 -f psp -muxvb 768
M4V80113.mp4

I typed this in almost verbatim and ran into the following error:

Code:

Unable to find a suitable output format for 'xvid'
Googling for this error yielded plenty of hits, but no solutions that were applicable to my situation. The real reason I'm posting this is so that hopefully when people search for that error in the future, they will stumble across my solution for it here.

The first thing I did was to simply take out the -vcodec xvid parameter. This resulted in another error, this time with 'aac' as the problem. I took out every single parameter until the only one left was -bitexact, and discovered that it takes an argument! The man page doesn't mention this. I just put a 1 after it, and that got me to this:

Code:

ffmpeg -y -i cnn.mpg -title "cnn" -timestamp "2005-04-08 03:12:36" -bitexact 1 -vcodec
xvid -s 320x240 -r 29.97 -b 1500 -acodec aac -ac 2 -ar 24000 -ab 64 -f psp -muxvb 768
M4V80113.mp4

This still didn't work. However, it was a lot closer to the right answer. While tinkering with it, I got various error messages including the following:

Code:

ffmpeg: unrecognized option '-muxvb'
WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Unknown encoder 'xvid'
Unknown encoder 'aac'

A very useful command I discovered at this point was "ffmpeg -formats" which prints out all the supported formats for ffmpeg. This allowed me to find "libxvid" and "libfaac," the proper names for the encoders I was trying to use. The exact commands are:

Code:

ffmpeg -formats | grep xvid
ffmpeg -formats | grep aac

After fiddling with the options a little bit more, I came up with the following command line entry:

Code:

ffmpeg -y -i cnn.mpg -title "cnn" -timestamp "2005-04-08 03:12:36" -bitexact 1 -vcodec
libxvid -s 320x240 -r 29.97 -b 1500 -acodec libfaac -ac 2 -ar 24000 -ab 65535 -f psp M4V80113.mp4

And this worked. Not only did it work, but I was able to immediately copy over and watch the video from my memcard. Notice the changes I had to make:

1) added parameter argument of 1 to -bitexact
2) took out unsupported (YMMV) -muxvb 768 option
3) replaced -vcodec xvid with -vcodec libxvid
4) replaced -acodec aac with -acodec libfaac
5) changed -ab 64 to -ab 65535

Good luck!

David the H. 02-07-2008 07:30 AM

Last year the ffmpeg bitrate flags (-b and -ab) were changed. They used to be read as kbits/sec, but now they've been changed to bits/sec. Any examples you find on the web older than a year or so will thus be way to low, and will probably either fail or drop to the default numbers.

You can change the rate to bps, as you've done here, or you can simply append 'k' to the original number, i.e. '-ab 64k'.

And from your description, it looks like changes to the format and codec names have also been made.

(By the way, did you notice that your video bitrate is still being read as 1500bps?)

allstarzero 02-07-2008 11:54 AM

By the way, did you notice that your video bitrate is still being read as 1500bps?

Hehe, yes I did notice (talk about a grainy video!). I forgot to post that part. Good catch.

454redhawk 02-13-2008 07:52 PM

Edit

Never mind I see you have it worked out.

Corley Kinnane 06-22-2008 10:59 AM

PSP AVC video encode
 
Hi,
I have made a perl script to convert DVDs to PSP.

Features:

- Auto frame rate conversion for PAL or interlaced NTSC source DVD down to 23.976

- embedded subtitles placed below the film if possible.

- others

This is a URL, guess the missing part:

corley.kinnane.net/blog/2008/06/22/psp-encode/

mencoder, ffmpeg and unix tools.

tredegar 06-22-2008 12:50 PM

Looks like nice work!
Although I don't have a PSP.
Welcome to LQ!

d33tah 08-10-2013 03:09 PM

As of ffmpeg 2.0, here's what works:

ffmpeg -y -i INPUTFILENAME -flags +bitexact -s 400x192 -r 29.97 -b:v 512k -acodec libfaac -b 672k -ab 96k -ar 24000 -f psp -strict -2 OUTPUTFILENAME.mp4


All times are GMT -5. The time now is 05:58 AM.