{"id":103,"date":"2020-02-13T16:56:00","date_gmt":"2020-02-13T16:56:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=103"},"modified":"2024-02-02T17:04:08","modified_gmt":"2024-02-02T22:04:08","slug":"converting-audio-and-video-file-formats-on-linux","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/converting-audio-and-video-file-formats-on-linux\/","title":{"rendered":"Converting audio and video file formats on Linux"},"content":{"rendered":"\n<p>The gold standard of converting audio and video file formats in Linux is&nbsp;<a target=\"_blank\" href=\"http:\/\/ffmpeg.org\/\" rel=\"noreferrer noopener\">FFmpeg<\/a>. It is a command-line tool capable of recording, converting and streaming audio and video. This article only covers audio and video file format conversion and show how easy it is to use.&nbsp;<strong>Installing FFmpeg<\/strong>&nbsp;Chances are that you already have FFmpeg installed on your system. Do the following to check to see, if it is installed.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ which ffmpeg \/usr\/bin\/ffmpeg<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ whereis ffmpeg ffmpeg: \/usr\/bin\/ffmpeg \/usr\/share\/ffmpeg \/usr\/share\/man\/man1<\/code><\/pre>\n\n\n\n<p>If it isn&#8217;t already installed, type the following if you have Ubuntu or another Debian system:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt-get install ffmpeg<\/code><\/pre>\n\n\n\n<p>or the following for Red Hat Family (RHEL, CentOS, Fedora)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ yum install ffmpeg<\/code><\/pre>\n\n\n\n<p>or use the following commands if you prefer to install from source:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ wget http:\/\/ffmpeg.org\/releases\/ffmpeg-0.6.1.tar.gz\n$ tar xzvf ffmpeg-0.6.1.tar.gz\n$ cd ffmpeg-0.6.1\n$ .\/configure\n$ .\/make\n$ sudo make install<\/code><\/pre>\n\n\n\n<p>ffmpeg-0.6.1 is the latest stable version at the time of the writing of this article. You should see what is available at&nbsp;<a href=\"https:\/\/molecularsciences.org\/web\/node\/_blank\">http:\/\/ffmpeg.org\/download.html<\/a><\/p>\n\n\n\n<p><strong>Converting audio and video file formats with FFmpeg<\/strong>&nbsp;For simple conversion, simply do the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ffmpeg -i original_file.mpg converted_file.avi<\/code><\/pre>\n\n\n\n<p>This would convert the file with default parameters, 200kbps video and 64 kbps audio. This is low quality conversion. To maintain, file quality, use the -sameq option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ffmpeg -i original_file.mpg -sameq converted_file.avi<\/code><\/pre>\n\n\n\n<p>There are many other options but most users are not interested in or understand the complex aspects and options for converting files. Most of us just want a small converted file we can post online or a conversion which maintains quality. If you need more power:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ man ffmpeg<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The gold standard of converting audio and video file formats in Linux is&nbsp;FFmpeg. It is a command-line tool capable of recording, converting and streaming audio and video. This article only covers audio and video file format conversion and show how easy it is to use.&nbsp;Installing FFmpeg&nbsp;Chances are that you already have FFmpeg installed on your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[35],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=103"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":104,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/103\/revisions\/104"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}