You are not logged in.
Pages: 1
I have some 500MB .mov files that need to me <30 MB so I can put them on youtube. How can I do this with mencode? I've looked around, but haven't been able to figure it out.
Fustrated Windows users have two options.
1. Resort to the throwing of computers out of windows.
2. Resort to the throwing of windows out of computers.
Offline
mencoder input.avi -o output.avi -oac lavc -ovc xvid -xvidencopts bitrate=1500
should be a good start.
But there are more options for scaling, etc - have a look at
http://davidmalin.blogspot.com/2007/08/ … -with.html
or have a look at avidemux for a gui.
Last edited by rebugger (2009-06-02 00:14:31)
Offline
sound doesn't seem to work on output file.
Fustrated Windows users have two options.
1. Resort to the throwing of computers out of windows.
2. Resort to the throwing of windows out of computers.
Offline
you could change "-oac lavc" to "-oac copy"
or check what's available on your system by running
mencoder -oac help
Offline
This'll do the trick, just a stripped down version of one of my other scripts:
#!/bin/sh
#script to calculate bitrate, scale & encode to mp4
#uses ffmpeg presets within ~/.ffmpeg (-vpre fast/-vpre vhq)
#examples: http://svn.mplayerhq.hu/ffmpeg/trunk/ffpresets
#depends: faac, ffmpeg & x264 (>20081002 recommended)
#use: ./2mp4 sourceVideo requiredWidth requiredSize(MB)
VID="$1"
WID="$2"
MB="$3"
DEST="${1%.*}.mp4"
#info
ffmpeg -i ${VID} 2> /tmp/$$
TH=`grep Duration /tmp/$$ | cut -d":" -f2 | cut -c 2-3`
TM=`grep Duration /tmp/$$ | cut -d":" -f3`
TS=`grep Duration /tmp/$$ | cut -d":" -f4 | cut -c 1-5`
SEC=$(echo "( ${TH} * 3600 ) + ( ${TM} * 60 ) + ${TS}" | bc)
RESX=`grep Video: /tmp/$$ | grep -o ....x | tr -d 'x '`
RESY=`grep Video: /tmp/$$ | grep -o x.... | tr -d 'x,'`
rm /tmp/$$ && echo ${RESX} ${RESY} ${SEC}
#height
ASPECT=$(echo "scale=3; ${RESX} / ${RESY}" | bc)
HEIGHT=$(echo "${WID} / ${ASPECT}" | bc)
MOD16=$(( ${HEIGHT} / 16 * 16 ))
echo ${MOD16}
#bitrate
RATE=$(echo "(( "$MB" * 1024 ) / ${SEC}) - 16" | bc)
R8=$(echo "(( ${RATE} * 8 ) * 1.02)" | bc)
KBPS=`echo "tmp=${R8}; tmp /= 1; tmp" | bc`
echo ${KBPS}
#encode
ffmpeg -i ${VID} -pass 1 -s ${WID}x${MOD16} -vcodec libx264 -vpre fast \
-b ${KBPS}k -threads 0 -rc_eq 'blurCplx^(1-qComp)' -level 41 -an "$DEST"
ffmpeg -i ${VID} -acodec libfaac -ac 2 -ab 128k -async 2 -pass 2 \
-s ${WID}x${MOD16} -vcodec libx264 -vpre vhq -b ${KBPS}k -threads 0 \
-rc_eq 'blurCplx^(1-qComp)' -level 41 -psnr -y "$DEST"
echo "Finished! Saved as ${DEST}"
You'll need some decent ffmpeg presets in ~/.ffmpeg/, I recommend you start with these. Usage is explained at the top of the script & the repo versions of said dep's are fine.
Hope it helps.
PS. Sorry, I missed the mencoder part... I only use it for its filters, ffmpeg seems more efficient with straight encodes.
Last edited by ahaslam (2009-06-06 18:30:26)
Offline
Pages: 1