Converting Audio and Video files using FFMPEG Tool

FFMPEG (Fast Forward Moving Pictures Expert Group):

FFmpeg is a  command line tool used for performing various conversion operations on audio and video files.

FFMPEG Installation:

FFmpeg is free and open source. You’ll be able to install it on your Windows PC as well as your Linux server.

sudo apt-get install software-properties-common python-software-properties

sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next

sudo apt-get update

sudo apt-get install ffmpeg

Basic Syntax:
The most basic form of an FFmpeg command

ffmpeg -i input_filename output_filename.extension

"ffmpeg" reads from an arbitrary number of input "files", specified by the -i option, and writes to an arbitrary number of output "files", which are specified by output filename.

import os
Input_file_path = '/home/xyz/Input_file_path.mp3'
Output_file_path = '/home/xyz/'(Path to store converted file)
os.system("ffmpeg -i "+Input_file_path+" -strict experimental "+Output_file_path+".extension")

This will convert the video/Audio to required formats.

Posted On 29 January 2013 By MicroPyramid


Need any Help in your Project?Let's Talk

Latest Comments
Related Articles
Python using yield and generators.

Generators are memory efficient. They allow us to code with minimum intermediate arguments, less data structures. Generators are of two types, generator expressions and generator ...

Continue Reading...
Understanding Python Properties

Python Properties is a class for managing class attributes in Python. Property( ) is a built-in function that creates and returns a property object

Syntax:
Continue Reading...

How to generate PDF Files from HTML In Python using PDFKIT

There are many approches for generating PDF in python. pdfkit is one of the better approache as, it renders HTML into PDF with various image ...

Continue Reading...
open source packages

Subscribe To our news letter

Subscribe and Stay Updated about our Webinars, news and articles on Django, Python, Machine Learning, Amazon Web Services, DevOps, Salesforce, ReactJS, AngularJS, React Native.
* We don't provide your email contact details to any third parties