Example #1
0
def transcode_file(path, newdir, newnamenoext='', ONLY=False):
  if not newnamenoext: newnamenoext = vsu.path2name(path)
  pathnoext = newdir+newnamenoext

  if not os.path.isfile(pathnoext+'.mov'): 
    # os.system('ffmpeg -y -i %s -an -b 400k %s.mov'%(path, pathnoext))
    os.system('ffmpeg -y -i %s -an -vcodec mjpeg -q 1 %s.mov'%(path, pathnoext))

  if ONLY: return

  wavpath = pathnoext+'.wav'
  wavmonopath = pathnoext+'_mono.wav'
  if not os.path.isfile(wavpath): 
    os.system('mplayer -framedrop -vo null -vc null -ao pcm:fast:waveheader:file="%s" "%s"'%(wavpath, path))
    os.system('rm %s'%path)
  #if not os.path.isfile(pathnoext+'.ogg'): 
  #  os.system('oggenc %s'%wavpath)

  if not os.path.isfile(wavmonopath): 
    os.system('sox %s -r 44100 --norm %s  remix -'%(wavpath, wavmonopath))
  os.system('rm %s'%wavpath)

  # get thumbnail
  if not os.path.isfile(pathnoext+'.gif'): 
    # os.system('convert %s.jpg %s.gif' % (nf,nf))
    os.system('convert -colors 10 -scale 50x50 %s.jpg %s.gif' % (pathnoext,pathnoext))
  os.system('rm %s.jpg'%pathnoext)
Example #2
0
def walk(rep_path):
    global no
    files = glob.glob(os.path.join(rep_path, "*.wav"))
    files.sort()
    for f in files:
        if not "mono" in f:
            oldfile = f
            monowav = oldfile.replace(".wav", "_mono.wav")
            comm = "sox --norm %s -b 16 -r 44100  %s  remix − dither -s" % (f, monowav)
            do(comm, vsu.path2name(f))
        no += 1
def walk(rep_path):
  global no
  files = glob.glob(os.path.join(rep_path,'*.flv'))
  files += glob.glob(os.path.join(rep_path,'*.mp4'))
  files.sort()
  for f in files:
    videopath = f
    pathnoext = f.replace('.mov', '')
    pathnoext = pathnoext.replace('.flv', '')
    name = vsu.path2name(pathnoext)
    comm = "mencoder %s -o /tmp/%s.flv -of lavf -vf scale=200:150 -ovc lavc -lavcopts vcodec=flv:vbitrate=50 -audiofile %s_mono.wav -oac mp3lame -lameopts cbr:br=48" % (f,name,pathnoext)
    do(comm)
    no+=1
Example #4
0
def walk(rep_path):
    global no
    files = glob.glob(os.path.join(rep_path, "*.mov"))
    files.sort()
    for f in files:
        movpath = f
        gifpath = f.replace(".mov", ".gif")
        jpgpath = f.replace(".mov", ".jpg")
        if not os.path.isfile(gifpath):
            comm = "ffmpeg -ss 00:00:10 -t 1 -i %s -f mjpeg %s" % (movpath, jpgpath)
            do(comm, vsu.path2name(f))
            comm = "convert -colors 10 -scale 50x50 %s %s" % (jpgpath, gifpath)
            do(comm)

        no += 1