Bash Loops multiplex A/V
I have a shell script I'm using to convert a large batch of those dreaded .wmv files.
here's my script which works perfect, for i in *.wmv ; do j=${i%.wmv} if [ -f "$i" ]; then rm -f "$i.wav" mkfifo "$i.wav" nice -n 15 mplayer -quiet -vo null -vc dummy "$i" -ao pcm:waveheader:file="$i.wav" & nice -n 15 lame -V5 -m m --vbr-new --resample 32000 "$i.wav" "$j.mp3" rm -f "$i.wav" fi done for i in *.wmv ; do j=${i%.wmv} nice -n 15 /usr/bin/mencoder -idx -ovc xvid -xvidencopts me_quality=6:fixed_quant=3:vhq=2:bf_threshold=1:max_bframes=1:hq_ac:chroma_me:chroma_opt:max_key_int erval=100:bvhq=1:min_iquant=1:max_iquant=31:min_pquant=1:max_pquant=31:min_bquant=1:max_bquant=31:no qpel:nogmc:trellis:nopacked:closed_gop:nocartoon:quant_type=mpeg -nosound -ofps 29.970 "$i" -o "$j.avi" done echo $? if [ $? == 0 ] ; then kdialog --msgbox "encoding successfull" ; then rm -f *.wmv elif [ $? == 1 ] ; then kdialog --error "sorry there were errors" ; exit fi The problem is I can't seem to find the proper way to get mencoder to multiplex the .avi with the .mp3. I've tried ten different ways,like if there's 10 .avi & 10 .mp3 how can I have mencoder match up the proper video and audio?? I know on 1 by 1 basis is simple enough "mencoder -idx -ovc copy -oac copy video.avi -audiofile audio.mp3 -o samename.AVI" I've read tutorials and googled and such but this one is stumping me. any help is appreciated Thank you all so kind!! |
Need only one loop, so grouping stuff together should work. Untested example so YMMV(VM):
Code:
#!/bin/sh |
All times are GMT -5. The time now is 11:29 AM. |