View Full Version : video encoding
02-03-2009, 07:29 PM
I am trying to encode a video-file for playing on the 5800XM.
Accoring to nokia, the phone can handle: "MPEG4-SP-uppspelning 30 bildrutor/sek VGA, MPEG4-AVC-uppspelning 30 bildrutor/sek QVGA, WMV9-uppspelning 30 bildrutor/sek QVGA, MPEG4-SP-uppspelning 30 bildrutor/sek nHD"
MPEG4-AVC = h264, right?
I use ffmpeg to encode the video, format: mp4 and codec: libx264 but the phone wont play the video, only the audio, wich is aac 96kb/s.
03-03-2009, 11:55 AM
If you have an AVI video and want to convert it to mp4 so you play it on your Nokia 5800 you can do it with the program ffmpeg doing th following:
ffmpeg -i a.avi -f mp4 -vcodec mpeg4 -b 750000 -s vga -acodec libfaac -ar 48000 -ab 96000 -ac 2 -async 2 movie.mp4
Where 750000 is the video bitrate, 96000 the audio bitrate, "-s vga" will resize the movie to 640x480 while "-async 2" will prevent audio and video to be out of sync.
03-03-2009, 03:36 PM
Well, that is what I do, I use ffmpeg, and I do mpeg4 and it works, however in the speccs it sais that the 5800 can display mpeg4-avc, wich is the h.264 codec(x264, libx264)...
However if I make a h264 encoded file in mp4 container at specified resolution (QVGA) it only plays the sound, not the video, so Im wonder what Im doing wrong?
03-03-2009, 03:41 PM
What is the exact command you use?
Are you using "-vcodec mpeg4"?
03-03-2009, 03:44 PM
yes, when im encoding mpeg, I use -vcodec mpeg4, and it works.
However, I want to do a h264(mpe4-avc) encoding, that is the thing that doesnt work for me. It sais in the specificatons that the phone can handle mpeg4-avc(h264) @ QVGA resolution, so im wonder where I do wrong...
For h264 encoding i use something like this:
ffmpeg -threads 3 -i <input file> -s qvga -r 24 -vcodec libx264 -f mp4 -b 600k -bt 100k -acodec libfaac -ab 96k <output file>
That command make a file that phone cant play the video of, but the sound works...
04-03-2009, 03:29 AM
See the post made by EvenOlder titled "H.264 Encoding Guidelines (Hard Experience)" in this forum. Sorry cannot post the direct thread link since I have low post count :tongue:
05-03-2009, 07:34 PM
Learn MeGui. Love it.
and read about my findings.
I'll answer any other questions
05-03-2009, 09:00 PM
MeGui sound an awful lot like a windows-application, however im on Linux...
Well, I have posted on the ffmpeg maillist and gotten some answeres, but dont seem to get to a decent quality/bitrate/size ratio, so I'm going to keep making mpeg4-files @ 900kb/s +- 100kb/s :)
Doesnt give much size-cutting, but some.. quality is more important then size :)
06-03-2009, 12:30 PM
Whatever you use, just follow the guidelines/limits I've listed on my previous post, and you'll get great looking results. h.264 is way better than mpeg4 stuff, and it shows on the phone.
352x288 max in either dimension
no CABAC, but I assume that you'd know that for mobile devices
Just show those things to your ffmpeg group, and they should write you up a nice command line.