Over a million developers have joined DZone.

Use Ffmpeg To Convert Flv To Mp4(or Avi)

·
you should have your ffmpeg path into the environment variables first.

import os
from re import match
path='E:\\blender tutorials\\' #you should change the directory before you run this code.
files=os.listdir(path)
for f  in files:
    if match('.+\.flv$',f):
        outf=f.replace('.flv','.mp4') #change mp4 to avi if you want avi files.
        os.system(r'ffmpeg.exe -i "%s" "%s"'%(path+f,path+outf))
Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}