I wrote it into a bash script for Linux, but the settings themselves should work for Mac or Windows. For batch processing, for now I'll just run the command several times on different files with && between them, but more automation would be nice.
Edit: The first few files worked fine, and then the next kept getting:
Too many video packets in the buffer: (1008 in 8395438 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.
I tried adding -ni but still getting the error. Will troubleshoot later.
The audio and subtitle options match most of what I watch, Japanese audio and English subtitles.
The video files I'm using are 1280x720. When I scale the width down to 480 proportionally, the height winds up 272. If I play the file, it expands the width to match the height and cuts off some video and messes with the subtitles. I can press a button to zoom it how I like every time I play a file, or I can use "expand" to add black lines and expand it to a height of 320.
With mencoder in Linux anyway, this tends to leave subtitle artefacts in the black lines if I encode it all at once, so I actually make a second pass just to add these black lines.
I had -noskip in there, copied from someone else's conversion for a different phone, but that was causing some "Too many video packets in the buffer:" errors. Thanks for the suggestion, repura! Also took the suggestion to loop it while it has input so I can, say, ./preconv.sh *.mkv
for input_file in "$@";
rm -f temp.mp4
/usr/bin/mencoder $input_file -o temp.mp4 $subtitle_width $subtitle_font_text_scale $subtitle_language $audio_language $audio_codec $video_codec $lavc_options $output_format $lavf_options $audio_filter $video_filter1 $maximum_sync_correction_per_frame $force_non_interleaved
/usr/bin/mencoder temp.mp4 -o $output_file $audio_codec $video_codec $lavc_options $output_format $lavf_options $audio_filter $video_filter2 $maximum_sync_correction_per_frame
When I run it with sample.mkv, it does this:
/usr/bin/mencoder sample.mkv -o temp.mp4 -subwidth 90 -subfont-text-scale 4 -slang eng,und -alang jpn,und -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:acodec=libfaac:abitr
/usr/bin/mencoder temp.mp4 -o sample.mkv.mp4 -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:acodec=libfaac:abitr