Rockbox General > Rockbox General Discussion

Can't get the command right to encode video; need help! [SOLVED]

(1/3) > >>

Strife89:
I am trying to use Mencoder to convert a few videos for use on my Sansa c200.
(I have already tested video playback on the Sansa with the iAudio X5 video. It works well!)
However, no matter how I tweak the command line (most notably by using the "-oac copy" command, since the lack of an mp3lame encoder has foiled other encoding programs), I cannot get the encoder to work properly.
I am using Ubuntu 7.10, and calling up the terminal takes me to "/home/michael"
My videos are all under "/home/michael/Videos". Some are .avi (and, on Windows, require the DivX codec package to play; they were made with Pocket DivX Encoder to make the originals playable on my Palm), and some are .mpg (not sure which one, either MPEG2 or MPEG4).

So, can anyone offer a command that I can paste the file names into, then paste it all into the terminal, and get it to work? :-[ I've tried everything I know....


--- Quote ---Sansa c200:  screen size: 132x80;   4:3 resolution: 106x80   16:9 resolution: 132x74

TERMINAL EXAMPLE:
mencoder -of mpeg -oac lavc -lavcopts acodec=mp2:abitrate=96:vmax_b_frames=16:vb_strategy=2 -af resample=44100:0:0 -ovc lavc -lavcopts
vcodec=mpeg2video:vbitrate= -vf scale=:,harddup -ofps 25 -o .mpg

VIDEO OPTIONS:
-ovc lavc  [output video module]
-lavcoptc vcodec=mpeg2video [output video codec]
...vmax_b_frames=16:vb_strategy=2 [the player needs as many b-frames as possible, to ease decoding and frame skipping]
(note: specify the video bitrate with: mpeg2video:vbitrate=)
-vf scale,harddup [scale the video, remove duplicate frames]
-ofps [output frames per second, depending on the target, adjust as needed]
-zoom [when scaling, zoom rather than crop]

AUDIO OPTIONS: (remember, I'm trying to just copy the audio; no reencoding at all)
-oac lavc [output audio module]
-lavcopts acodec=mp3:abitrate=192 [output audio codec and bitrate, mp1/mp2/mp3 can be used]
(note: if your video already has a compatible audio track simply use '-oac copy' to copy it to the output file without transcoding)
-af resample=44100:0:0 [resample to 44.1 kHz, otherwise it won't play at proper speed]
--- End quote ---

cpchan:
What is the problem when you use -oac copy (if the audio is compatible with your device)? Please provide a commandline example when you are copying. Also, no one can help you if you don't post the errors you are getting. FWIW, here is a script that I personally use for my e280. You will need to change the values of a few variables at the top of the file to match your device and likings. Also, at present, all the source mpeg files should have the extensive mpeg and not mpg. I also need to add logic to detect a compatible audio track and copy instead of transcoding to mp3.

Charles
 

Strife89:
Attached is a text file is was using to conduct edits; this is the last state I saved it in.

Error messages will come in detail later, but on my last attempt, it basically told me it was skipping every frame in the file -- s-l-o-w-l-y, and I had to hit the key to halt the process.

Most errors wouldn't allow encoding to get started.

EDIT: I have no idea how to execute your script!  :-[  (Double clicking it launches a text editor. Dragging it into the terminal window produces this:)

--- Quote ---TERMINAL:
root@CarrDesktop:/home/michael# '/home/michael/Videos/Test/encode.sh'
bash: /home/michael/Videos/Test/encode.sh: Permission denied
--- End quote ---

cpchan:

--- Quote from: Strife89 on January 25, 2008, 09:44:12 PM ---Error messages will come in detail later, but on my last attempt, it basically told me it was skipping every frame in the file -- s-l-o-w-l-y, and I had to hit the key to halt the process.
--- End quote ---

This is normal for some input source- wait for it to finish. I tested your commandlines, other then forgetting to add " lavc -lavcopts" in the first 2 examples, they work fine. Boy, is the screen on the c200 small.

Charles


cpchan:

--- Quote from: Strife89 on January 25, 2008, 09:44:12 PM ---I have no idea how to execute your script!  :-[  (Double clicking it launches a text editor. Dragging it into the terminal window produces this:)

--- Quote ---TERMINAL:
root@CarrDesktop:/home/michael# '/home/michael/Videos/Test/encode.sh'
bash: /home/michael/Videos/Test/encode.sh: Permission denied
--- End quote ---

--- End quote ---

I presume you renamed the script to encode.sh. Do this in a terminal, if you have root access:


--- Code: ---sudo chmod 755 /home/michael/Videos/Test/encode.sh
--- End code ---

if not:


--- Code: ---chmod u+x /home/michael/Videos/Test/encode.sh
--- End code ---

Now put it some where on your path or else you will need to specify where it is, such as:


--- Code: ---/home/michael/Videos/Test/encode.sh
--- End code ---

or  ./encode.sh if you are in the directory where it is.

The syntax to run the script is:


--- Code: ---encode.sh
--- End code ---

the easiest way to do it is to put all the files you want to transcode into an empty directory. Change to the directory and do:


--- Code: ---encode.sh *
--- End code ---

Charles

Navigation

[0] Message Index

[#] Next page

Go to full version