You are not logged in.
I have a cheap portable video player which (according to a supplied Windows software configuration file) requires any video to be converted (say from a YouTube .flv) using a command line like:
mencoder myfile.flv -ofps 15 -vf-add scale=160:128 -vf-add expand=160:128:-1:-1:1 -srate 44100 -ovc xvid -stereo 0 -xvidencopts bitrate=300:max_bframes=0:quant_type=h263:me_quality=0 -oac lavc -lavcopts acodec=mp2:abitrate=128 -o myfile.aviIf I do the conversion on Linux - my fully-upgraded Arch - the resulting .avi file has the audio and video out of sync when played with Mplayer (on Linux and Windows), and no audio at all when played with Vlc (on Linux and Windows). But if I do (supposedly) exactly the same conversion using Mencoder on Windows, the resulting .avi file plays perfectly on everything on both Linux and Windows (and also the portable video player).
Here's the version information for the Mencoders being used:
Windows: MEncoder Sherpya-MinGW-20060312-4.1.0 (C) 2000-2006 MPlayer Team
Arch: MEncoder SVN-r32492-4.5.1 (C) 2000-2010 MPlayer Team
I'd be grateful for any ideas as to how to make my Mencoder conversion work as well on Linux as it does on Windows XP! (Or is there something wrong with the way I'm playing the file with Mplayer and Vlc on Arch?!)
Last edited by ninian (2010-11-16 23:28:02)
Offline
If you really want to use mencoder this reply will probably be useless to you, but a few months ago i wanted to convert a bunch of videos to AVI too, and upload them to my phone which is also a bit touchy about what it can play. I ended up using VLC and it worked flawlessly so you might want to explore that option until someone comes up with a suggestion for mencoder. It has a nice gui wizard built in as well.
http://wiki.videolan.org/Transcode
http://www.videolan.org/doc/streaming-h … /ch02.html
Offline
I ended up using VLC and it worked flawlessly so you might want to explore that option until someone comes up with a suggestion for mencoder. It has a nice gui wizard built in as well.
Thanks for that suggestion - I hadn't thought of Vlc to do this and will experiment a bit with it. I certainly don't mind finding another method of achieving the conversion, as long as it's reliable. I normally use ffmpeg for conversions, but it's beyond my knowledge to try and work out what's needed in the way of parameters, based on the Mencoder ones.
Offline
AFAIK it's very reliable and quite powerful when it comes to streaming & transcoding so i always keep VLC around even though i prefer to use mplayer as my default video player.
About mencoder, if you're using the same flags/options i would note that they are totally different versions and i remember that there were some bugs when converting from/to certain formats last time i tried it. But that was some time ago, someone more well versed in mencoder than me could confirm if that's still the case.
Offline
Aha! I think I've cracked it, but using ffmpeg instead, with options prompted by this blog post:
ffmpeg -i infile.flv -r 15 -vcodec mpeg4 -vtag XVID -s 160x128 -aspect 4:3 -qmin 3 -qmax 5 -ar 44100 -ab 128k -ac 2 -acodec mp2 -g 1 outfile.aviThis seems to work everywhere, and the writer specially notes that:
The most important option is the -g 1 to force every frame to be a keyframe
which may well be where my conversions were going wrong. So I'll mark this as 'solved' even though mencoder is still a mystery, but I have learned to keep Vlc up my sleeve, so thanks for that tip again.
Offline
It's a very bad idea to have every frame as a keyframe in terms of video compression, you might as well use Motion JPEG instead. If there was a video sample with your portable player or if you can find one can you check if every frame is a keyframe? (I don't know a linux tool which provides that info though, MediaInfo doesn't and iirc avidemux neither, but I'm sure VirtualDub or eventually Gspot on windows can help you).
Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness.
Picasso
Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.
Saint Exupéry
Offline
It's a very bad idea to have every frame as a keyframe in terms of video compression, you might as well use Motion JPEG instead. If there was a video sample with your portable player or if you can find one can you check if every frame is a keyframe? (I don't know a linux tool which provides that info though, MediaInfo doesn't and iirc avidemux neither, but I'm sure VirtualDub or eventually Gspot on windows can help you).
Hmmm... will investigate further, thanks.
Offline