<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lug.mtu.edu/w/index.php?action=history&amp;feed=atom&amp;title=FFmpeg</id>
	<title>FFmpeg - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lug.mtu.edu/w/index.php?action=history&amp;feed=atom&amp;title=FFmpeg"/>
	<link rel="alternate" type="text/html" href="https://lug.mtu.edu/w/index.php?title=FFmpeg&amp;action=history"/>
	<updated>2026-04-30T03:10:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://lug.mtu.edu/w/index.php?title=FFmpeg&amp;diff=6984&amp;oldid=prev</id>
		<title>imported&gt;Sjwhitak: More verbose</title>
		<link rel="alternate" type="text/html" href="https://lug.mtu.edu/w/index.php?title=FFmpeg&amp;diff=6984&amp;oldid=prev"/>
		<updated>2022-06-05T00:02:05Z</updated>

		<summary type="html">&lt;p&gt;More verbose&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:02, 5 June 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 50:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Encoders ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Encoders ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following is a verbose manner of defining encoders:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following is a verbose manner of defining encoders:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{UserCmd|ffmpeg -vcodec copy -acodec copy -scodec copy out.mp4}}&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{UserCmd|ffmpeg -vcodec copy -acodec copy -scodec copy&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; -map 0:v:0 -map 0:a:0 -map 0:s:0&lt;/ins&gt; out.mp4}}&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The video codec (&amp;lt;code&amp;gt;-vcodec&amp;lt;/code&amp;gt;) and the subtitle codec (&amp;lt;code&amp;gt;-scodec&amp;lt;/code&amp;gt;) are used to transform the video stream (&amp;lt;code&amp;gt;0:v:0&amp;lt;/code&amp;gt;) and the subtitle stream (&amp;lt;code&amp;gt;0:s:0&amp;lt;/code&amp;gt;) into the output file (&amp;lt;code&amp;gt;out.mp4&amp;lt;/code&amp;gt;). The term &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for each codec simply uses whatever codec is used in the original file, &amp;lt;code&amp;gt;movie.mk4&amp;lt;/code&amp;gt;. &lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The video codec (&amp;lt;code&amp;gt;-vcodec&amp;lt;/code&amp;gt;) and the subtitle codec (&amp;lt;code&amp;gt;-scodec&amp;lt;/code&amp;gt;) are used to transform the video stream (&amp;lt;code&amp;gt;0:v:0&amp;lt;/code&amp;gt;) and the subtitle stream (&amp;lt;code&amp;gt;0:s:0&amp;lt;/code&amp;gt;) into the output file (&amp;lt;code&amp;gt;out.mp4&amp;lt;/code&amp;gt;). The term &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for each codec simply uses whatever codec is used in the original file, &amp;lt;code&amp;gt;movie.mk4&amp;lt;/code&amp;gt;. &lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key lug_wiki:diff:wikidiff2:1.12:old-6983:rev-6984:1.13.0 --&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Sjwhitak</name></author>
	</entry>
	<entry>
		<id>https://lug.mtu.edu/w/index.php?title=FFmpeg&amp;diff=6983&amp;oldid=prev</id>
		<title>imported&gt;Sjwhitak: Created page with &quot;[https://ffmpeg.org/ FFmpeg] is a really complicated, all-in-one software that deals with videos and encoders. The software is typically not packaged with anything because some encoders are non-free and package managers don&#039;t typically use a version with the non-free encoders. So, you&#039;ll need to download it yourself  https://ffmpeg.org/download.html unless you really care about the notion that there&#039;s non-free software on your computer.   FFmpeg is mainly the backend to...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lug.mtu.edu/w/index.php?title=FFmpeg&amp;diff=6983&amp;oldid=prev"/>
		<updated>2022-06-04T23:58:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;[https://ffmpeg.org/ FFmpeg] is a really complicated, all-in-one software that deals with videos and encoders. The software is typically not packaged with anything because some encoders are non-free and package managers don&amp;#039;t typically use a version with the non-free encoders. So, you&amp;#039;ll need to download it yourself  https://ffmpeg.org/download.html unless you really care about the notion that there&amp;#039;s non-free software on your computer.   FFmpeg is mainly the backend to...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[https://ffmpeg.org/ FFmpeg] is a really complicated, all-in-one software that deals with videos and encoders. The software is typically not packaged with anything because some encoders are non-free and package managers don&amp;#039;t typically use a version with the non-free encoders. So, you&amp;#039;ll need to download it yourself  https://ffmpeg.org/download.html unless you really care about the notion that there&amp;#039;s non-free software on your computer. &lt;br /&gt;
&lt;br /&gt;
FFmpeg is mainly the backend to software like [https://www.vegascreativesoftware.com/us/ Song Vegas] and [https://www.openshot.org OpenShot], but you can use FFmpeg for small video edits like re-encoding and scripting multiple audio files at once. Since FFmpeg is such a behemoth of a software, here are some examples.&lt;br /&gt;
&lt;br /&gt;
= Simple commands =&lt;br /&gt;
I consider a simple edit to be any edit that does not re-encode your streams.&lt;br /&gt;
{{UserCmd|ffmpeg -i video.mp4 -ss 1:00 -t 2:00 out.mp4}}&lt;br /&gt;
This will start the video at 1 minute and end at 2 minutes.&lt;br /&gt;
{{UserCmd|ffmpeg -i video.mp4 -an out.mp4}}&lt;br /&gt;
This will remove audio from the video if there was audio previously.&lt;br /&gt;
{{UserCmd|ffmpeg -re -i out.mp4 -acodec copy -vcodec copy -f flv -y rtmp://localhost/live/livestream}}&lt;br /&gt;
This will stream your video to [https://github.com/ossrs/srs SRS]. &lt;br /&gt;
= Complicated  edits =&lt;br /&gt;
I consider a complicated edit to be any edit that will re-encode your streams. When you encode files, it takes a long time. Expect to take around real-time (running your code for 1 hour for a 1 hour video) for any command that re-encodes your streams.&lt;br /&gt;
&lt;br /&gt;
At this point, we focus on properly handling streams. According to FFmpeg, streams are either audio, visual, or subtitles. If there are multiple video streams, the process to handle each one is:&lt;br /&gt;
 0:v:0&lt;br /&gt;
 0:v:1&lt;br /&gt;
 0:v:2&lt;br /&gt;
 ...&lt;br /&gt;
This shows 3 different video streams on your first input. You can have multiple inputs, for example:&lt;br /&gt;
{{UserCmd|ffmpeg -i movie.mp4 -i overlay.mp4 -i music.mp4 ...}}&lt;br /&gt;
In this case, you&amp;#039;ll have 3 inputs, and if each mp4 has multiple video streams, then you need to handle them like so:&lt;br /&gt;
 0:v:0&lt;br /&gt;
 0:v:1&lt;br /&gt;
 0:v:2&lt;br /&gt;
 1:v:0&lt;br /&gt;
 2:v:0&lt;br /&gt;
Typically, there really aren&amp;#039;t multiple video streams, like, ever, but there are typically multiple audio streams for dubbing in different languages. Audio streams are:&lt;br /&gt;
 0:a:0&lt;br /&gt;
and subtitle streams are:&lt;br /&gt;
 0:s:0&lt;br /&gt;
&lt;br /&gt;
== Rate modification ==&lt;br /&gt;
{{UserCmd|ffmpeg -i phone_video.mp4 -b:v 2M out.mp4}}&lt;br /&gt;
Your phone records at an extremely high bitrate and it&amp;#039;s not required to be such a massive file.  Reducing your video bitrate (&amp;lt;code&amp;gt;-b:v&amp;lt;/code&amp;gt;) is a good way to reduce the size of your files before uploading to a server.&lt;br /&gt;
{{UserCmd|ffmpeg -i music.mp3 -ar 44100 out.mp3}}&lt;br /&gt;
This sets your audio sample rate to &amp;lt;code&amp;gt;44100&amp;lt;/code&amp;gt;, or 44.1kHz, a standard sample rate for speakers.&lt;br /&gt;
&lt;br /&gt;
== Subtitle example ==&lt;br /&gt;
Suppose you have a .srt or a .ass file with your subtitles and you want to hardcode them before streaming them. &lt;br /&gt;
{{UserCmd|ffmpeg -i movie.mp4 -vf &amp;quot;subtitles&amp;amp;#x3d;sub.srt&amp;quot; out.mp4}}&lt;br /&gt;
More typically, subtitles are embedded into an mkv or avi file, and as such, you&amp;#039;ll need to hardcode from a stream inside the file itself using multiple streams. This depends upon the subtitle stream itself, but if the stream is a text stream, then you can use a text encoder:&lt;br /&gt;
{{UserCmd|ffmpeg -i movie.mkv -map 0:v:0 -map 0:s:0 out.mp4}}&lt;br /&gt;
&lt;br /&gt;
If you have a bitmap-based subtitle stream (dvb is bitmap-based, srt/ass is text-based), you need to overlay the subtitles onto the movie itself.&lt;br /&gt;
&lt;br /&gt;
{{UserCmd|ffmpeg -i movie.mkv -filter_complex &amp;quot;[0:v:0][0:s:0]overlay&amp;quot; out.mp4}}&lt;br /&gt;
&lt;br /&gt;
== Encoders ==&lt;br /&gt;
The following is a verbose manner of defining encoders:&lt;br /&gt;
{{UserCmd|ffmpeg -vcodec copy -acodec copy -scodec copy out.mp4}}&lt;br /&gt;
The video codec (&amp;lt;code&amp;gt;-vcodec&amp;lt;/code&amp;gt;) and the subtitle codec (&amp;lt;code&amp;gt;-scodec&amp;lt;/code&amp;gt;) are used to transform the video stream (&amp;lt;code&amp;gt;0:v:0&amp;lt;/code&amp;gt;) and the subtitle stream (&amp;lt;code&amp;gt;0:s:0&amp;lt;/code&amp;gt;) into the output file (&amp;lt;code&amp;gt;out.mp4&amp;lt;/code&amp;gt;). The term &amp;lt;code&amp;gt;copy&amp;lt;/code&amp;gt; for each codec simply uses whatever codec is used in the original file, &amp;lt;code&amp;gt;movie.mk4&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If you want to use a specific codec, &lt;br /&gt;
&lt;br /&gt;
{{UserCmd|ffmpeg -i movie.mkv -vcodec libx264 -scodec copy -map 0:v:0 -map 0:s:0 -map 0:a:0 out.mp4}}&lt;br /&gt;
&lt;br /&gt;
Typically, audio codecs are standardized and each output format will accept the audio codecs. &amp;lt;code&amp;gt;libx264&amp;lt;/code&amp;gt; is used for mp4 files, &amp;lt;code&amp;gt;libvpx-vp9&amp;lt;/code&amp;gt; is used for webm files and these are non-free codecs. To go from .mp4 to .webm to reduce the video size:&lt;br /&gt;
{{UserCmd|ffmpeg -i video.mp4 -c:v libvpx-vp9 -b:v 1M out.webm}}&lt;br /&gt;
&amp;lt;code&amp;gt;-b:v&amp;lt;/code&amp;gt; sets the bitrate to 1 MB/s, which should reduce the size down to below 2MB and &amp;lt;code&amp;gt;-an&amp;lt;/code&amp;gt; removes noise, which should allow you to post your video on a certain website.&lt;/div&gt;</summary>
		<author><name>imported&gt;Sjwhitak</name></author>
	</entry>
</feed>