All pastes #544714 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-06 15:38 UTC
rendered paste body
import glob, os
from os.path import join, getsize


vlc_ps3 = "\"C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\\ffmpeg.exe\" -y -i \"FILENAME_SRC\" -f mp4 -vcodec xvid -r 24000/1001 -b 1536k -bufsize 2500k -maxrate 2500k -g 250 -acodec aac -ac 2 -ab 128k \"FILENAME_DST\""
vlc_n95 = "\"C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\\ffmpeg.exe\" -i \"FILENAME_SRC\" -s 320x240 \"FILENAME_DST\""
raiz = "d:\\"
filelist = []

while(1):
           
    for root, dirs, files in os.walk(raiz):
        for item in files:
            item = item.lower()
            if (item.rfind('.mp4') == -1 and item.rfind('.avi') != -1):
                filelist.append(root + "\\" + item)
     
    print filelist
    
    for file in filelist:
        print file
        vlc_ps3 = vlc_ps3.replace("FILENAME_SRC", file)
        vlc_ps3 = vlc_ps3.replace("FILENAME_DST", file.replace(".avi", ".mp4"))
        print vlc_ps3
        os.popen(vlc_ps3)
        
        vlc_n95 = vlc_n95.replace("FILENAME_SRC", file.replace(".avi", ".mp4"))
        vlc_n95 = vlc_n95.replace("FILENAME_DST", file.replace(".avi", ".N95.mp4"))
        
        print vlc_n95
        os.popen(vlc_n95)    
        
        #os.remove(file)
        print "FILE", file, " HAS BEEN ENCODED !!"
    Thread.sleep(60000)
    filelist = []