LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-02-2008, 09:27 AM   #1
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 32
How to encode MP4 videos for SE k800i?


Hello,
I have Sony Ericsson k800i and I want to encode some videos to watch on it. Here are its supported codecs:
Code:
# MP3, WMA, RealAudio 8 and AAC/AAC+/eAAC+ audio
# MP4, 3GP and RealVideo 8 video
I want to use mencoder.
Here I have a video 253can-low.avi which is 320x240, so I won't had to care of resizing for now.
I tried following:
Code:
/usr/local/bin/mencoder 253can-low.avi -o out.mp4 -ovc x264 -oac mp3lame
(I have another mplayer and mencoder installed in /usr/bin, but they are compiled at time I did not had x264 installed)
And I get the following:
Code:
MEncoder 1.0rc2-3.4.6 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (Family: 15, Model: 4, Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2


WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.
success: format: 0  data: 0x0 - 0x20cb000
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO:  [DX50]  320x240  24bpp  29.970 fps  299.9 kbps (36.6 kbyte/s)
[V] filefmt:3  fourcc:0x30355844  size:320x240  fps:29.97  ftime:=0.0334
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 12000 Hz, 2 ch, s16le, 16.0 kbit/4.17% (ratio: 2000->48000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
MP3 audio selected.
VDec: vo config request - 320 x 240 (preferred colorspace: Planar YV12)
VDec: using Planar I420 as output csp (no 1)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
x264 [error]: no ratecontrol method specified
x264_encoder_open failed.
FATAL: Cannot initialize video driver.

Exiting...
I'm not sure if there must be added additional options for x264? Or I'm completely wrong about x264 and I don't need it?
What is the simpliest way to encode video for that phone?

Update: I tried using lavc:
Code:
mencoder 253can-low.avi -o out.mp4 -ovc lavc -lavcopts vcodec=mpeg4 -oac mp3lame
But the output file size is way too big: input file of 33MB became output file 85MB. I don't think this is correct, becouse it pushes the bitrate from
Code:
VIDEO:  [DX50]  320x240  24bpp  29.970 fps  299.9 kbps (36.6 kbyte/s)
To:
Code:
VIDEO:  [FMP4]  320x240  24bpp  29.970 fps  812.7 kbps (99.2 kbyte/s)
Update2: I managed to limit the bitrate at 384Kbps as suggested and the filesize was 35MB, but once I upload that clip to the phone it won't play it. It doesn't have 'view' option nor preview - I think something is wrong with the mencoder settings.

Last edited by ivanatora; 01-02-2008 at 10:28 AM.
 
Old 01-02-2008, 03:46 PM   #2
gacott
LQ Newbie
 
Registered: Dec 2002
Posts: 22

Rep: Reputation: 15
MediaCoder

I don't know, but the older I get the less I want to mess with a number of things . . . Video encoding is one of them. I run MediaCoder http://mediacoder.sourceforge.net/ under wine and it does the job just great for me. It is open source and they are working on a native Linux version also . . . but it really does run just fine in wine.
 
Old 09-09-2009, 12:31 AM   #3
xs_gandalf
LQ Newbie
 
Registered: Sep 2009
Posts: 1

Rep: Reputation: 0
Lightbulb Solution

If You have avidemux (or ubuntu), follow the screenshots here:

(url banned, just google for "k800i mencoder")

(all GUI, maybe except "sudo apt-get install ...", which can be done with a GUI too).

For mencoder, which You seem to prefer, there is a solution in the comments below that post:

mencoder -ofps 24 -of lavf -lavfopts format=mp4 -af lavcresample=48000:channels=1 -vf-add harddup -vf-add scale=320:-2 -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:acodec=libfaac:abitrate=128:vcodec=mpeg4:vbitrate=384:keyint=25 -subfont-text-scale 4 -subcp cp1250 -sws 9 input_file.avi -sub subtitle_file.txt -o output.mp4

If You don't need subtitles, this simplifies to:

mencoder -ofps 24 -of lavf -lavfopts format=mp4 -af lavcresample=48000:channels=1 -vf-add harddup -vf-add scale=320:-2 -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:acodec=libfaac:abitrate=128:vcodec=mpeg4:vbitrate=384:keyint=25 input_file.avi -o output.mp4

(I leave the scaling, because it doesn't hurt, I think).

I tried with -ofps ranging from 15 to 24 (with 23.9.. something), but I don't see any significant difference on the phone. It may have some internal framedrop...
 
Old 08-14-2012, 12:52 PM   #4
eglisius.rezidokularakis
LQ Newbie
 
Registered: Aug 2012
Posts: 1

Rep: Reputation: Disabled
Thumbs up

I tried xs_gandalf's mencoder method without subtitles under Ubuntu 12.04, and it worked fine--after having replaced "acodec=libfaac" by "acodec=aac". Thanks a lot!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mp4 encoder Brocolli Linux - Software 2 07-01-2007 11:44 PM
OGG to MP4 ? waelaltaqi Linux - Software 1 06-14-2007 04:20 PM
Combining .mp4 videos Poetics Linux - General 1 05-29-2007 08:30 PM
Can Banshee Encode .mp3 and .mp4? General_Tso Linux - Software 2 06-26-2006 12:24 AM
acidrip cant encode... tijn_sol Linux - Software 1 01-24-2006 06:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration