[MEncoder-users] How to repackage MP4 files to avi container?

Miroslav Rovis m.rovis at inet.hr
Mon May 17 06:20:33 CEST 2010

Hash: SHA1

(the Subject line of this message is not anymore to the point, but the
previous discussion in the thread is also of relevance, so why change it)
Here is my avi2mp4.sh improved.
Select from "FROM HERE" to "UP TO HERE" but without the dashed lines
themselves, right click, Copy, open a text editor and then Paste in
the text editor, Save as avi2mp4.sh into /usr/local/bin and do, on the
command line:
# cd /usr/local/bin
# chmod 755 avi2mp4.sh
- ------------------------------- FROM HERE --------------------------
echo ""
echo "This script will repackage your h264/aac avi file (made with
mencoder or some other program) to possibly well-synced mp4 file only
if the fps is 25. Modify it for purposes of NTSC or other fps!"
echo ""
echo "View the script in text viewer for more!"
echo ""
echo "!!!!!  ---- Did you backup before trying this out? ----  !!!!!!"
echo "Hit Enter if you're ready to go!"
read FAKE
# There are sync issues with mp4 container thay seem not
# to have been properly addressed yet.
# Also, be aware that there are other more sophisticated
# scripts available freely on the net. The thing is, they
# don't work for me, and this script, that suits only the
# particular purpose of h264/aac avi's encoded with
# mencoder or possibly other program, or similar avi
# files, and that does no resolution calculation or other
# stuff, is just what I need right now for my avi files
# (see mencoder  mailing list archives for April 2010)
# And I thought to share it.
# Miroslav Rovis
# www.CroatiaFidelis.hr
# www.exDeo.com

v1=`echo $1 | cut -d '.' -f1`
MP4Box -aviraw audio $v1.avi
MP4Box -aviraw video $v1.avi
mv -iv ${v1}_audio.raw ${v1}_audio.aac
MP4Box -add ${v1}_audio.aac $v1.mp4
MP4Box -add ${v1}_video.h264 $v1.mp4
echo "Cleaning..."
rm ${v1}_audio.aac
rm ${v1}_video.h264
echo "Type y if you're sure you don't need the avi file"
echo "Type n if you want to check the mp4 file first and delete the
avi manually"
rm -i $v1.avi
- ------------------------------- UP TO HERE --------------------------

>> And if anyone knows of a good tutorial on subtitle ripping (or
>> whatever it's called), pls. let me know!
>> I have some TV footage taken with my old Vista with Hauppauge
>> HVR-3000 ... in FILES*.ts (transport stream) files, and some have
>> subtitles in them...
It's free-to-air digital TV captured footage.
I have little time available to dedicate to this learning... And I
need it really...

Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the MEncoder-users mailing list