snipt

Ctrl+h for KB shortcuts

Bash

Convert mp4 to flv

ffmpeg -i ./video.mp4 -f flv -vb 800k -ab 196k -ar 44100 -r 30 -vf "scale=704:396,pad=704:576:0:90:black" ./video.flv 2>&1
https://snipt.net/embed/2f5ffbcef392c475ab9dd27ef7c42a3d/
https://snipt.net/raw/2f5ffbcef392c475ab9dd27ef7c42a3d/
2f5ffbcef392c475ab9dd27ef7c42a3d
bash
Bash
1
2016-09-26T19:17:09
True
False
False
/api/public/snipt/55765/
convert-mp4-to-flv
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>ffmpeg -i ./video.mp4 -f flv -vb 800k -ab 196k -ar <span class="m">44100</span> -r <span class="m">30</span> -vf <span class="s2">&quot;scale=704:396,pad=704:576:0:90:black&quot;</span> ./video.flv 2&gt;<span class="p">&amp;</span>1 </span></pre></div> </td></tr></table>
bash, ffmpeg

Text only

crop mp3 using ffmpeg

ffmpeg -i source.mp3 -acodec copy -t 00:03:15 -ss 00:00:00 target.mp3 
https://snipt.net/embed/7c3572cc1dcd52b2162125c3cd1ab671/
https://snipt.net/raw/7c3572cc1dcd52b2162125c3cd1ab671/
7c3572cc1dcd52b2162125c3cd1ab671
text
Text only
1
2016-09-20T11:47:53
True
False
False
Jan 26, 2013 at 01:09 AM
/api/public/snipt/54529/
crop-mp3-using-ffmpeg
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>ffmpeg -i source.mp3 -acodec copy -t 00:03:15 -ss 00:00:00 target.mp3 </span></pre></div> </td></tr></table>
bash, ffmpeg, mp3

Bash

Extract images from video

ffmpeg -i MyVideo.mp4 -y -f image2 MyFolder/output%04d.png
https://snipt.net/embed/f63548f3fc94662c748c5e302030a474/
https://snipt.net/raw/f63548f3fc94662c748c5e302030a474/
f63548f3fc94662c748c5e302030a474
bash
Bash
1
2016-09-27T00:22:29
True
False
False
/api/public/snipt/28392/
extract-images-from-video
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>ffmpeg -i MyVideo.mp4 -y -f image2 MyFolder/output%04d.png </span></pre></div> </td></tr></table>
bash, ffmpeg

Bash

Convert png frames into an mpeg4 movie

# -qscale <quality>[1, 31], -r <frame-rate> -b <bit-rate>
ffmpeg -qscale 1 -r 2 -b 9600 -i %03d.png movie.mp4
https://snipt.net/embed/4fb89a7398caef2c7bd9113fe8ce60e9/
https://snipt.net/raw/4fb89a7398caef2c7bd9113fe8ce60e9/
4fb89a7398caef2c7bd9113fe8ce60e9
bash
Bash
2
2016-09-22T00:20:09
True
False
False
/api/public/snipt/28023/
convert-png-frames-into-an-mpeg4-movie
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c"># -qscale &lt;quality&gt;[1, 31], -r &lt;frame-rate&gt; -b &lt;bit-rate&gt;</span> </span><span id="L-2"><a name="L-2"></a>ffmpeg -qscale <span class="m">1</span> -r <span class="m">2</span> -b <span class="m">9600</span> -i %03d.png movie.mp4 </span></pre></div> </td></tr></table>
ffmpeg, movie, mp4, png

Bash

Install Ffmpeg with x264 and aac encoder

1
2
3
4
#Install Medibuntu
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
#Install ffmpeg lib
sudo apt-get install libavcodec-extra-52 libavdevice-extra-52 libavfilter-extra-0 libavformat-extra-52 libavutil-extra-49
https://snipt.net/embed/6714de92700888b7b021fa376df453a8/
https://snipt.net/raw/6714de92700888b7b021fa376df453a8/
6714de92700888b7b021fa376df453a8
bash
Bash
4
2016-09-26T23:42:51
True
False
False
/api/public/snipt/18485/
install-ffmpeg-with-x264-and-aac-encoder
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c">#Install Medibuntu</span> </span><span id="L-2"><a name="L-2"></a>sudo wget --output-document<span class="o">=</span>/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/<span class="k">$(</span>lsb_release -cs<span class="k">)</span>.list <span class="o">&amp;&amp;</span> sudo apt-get --quiet update <span class="o">&amp;&amp;</span> sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring <span class="o">&amp;&amp;</span> sudo apt-get --quiet update </span><span id="L-3"><a name="L-3"></a><span class="c">#Install ffmpeg lib</span> </span><span id="L-4"><a name="L-4"></a>sudo apt-get install libavcodec-extra-52 libavdevice-extra-52 libavfilter-extra-0 libavformat-extra-52 libavutil-extra-49 </span></pre></div> </td></tr></table>
codec, ffmpeg, h264, ubuntu, video, x264

Bash

Generate screencap via ffmpeg

find -iregex ".*\.\(flv\|wmv\|avi\|mpeg\|mpg\)" -exec ffmpeg -i {} -f image2 -y -an -ss 00:00:21 -sameq -b 2k -r 0.004 "{}.%01d.jpg" \;
https://snipt.net/embed/efda99e04911a560b84f998bec0d3752/
https://snipt.net/raw/efda99e04911a560b84f998bec0d3752/
efda99e04911a560b84f998bec0d3752
bash
Bash
1
2016-09-17T22:49:26
True
False
False
/api/public/snipt/14008/
generate-screencap-via-ffmpeg
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>find -iregex <span class="s2">&quot;.*\.\(flv\|wmv\|avi\|mpeg\|mpg\)&quot;</span> -exec ffmpeg -i <span class="o">{}</span> -f image2 -y -an -ss 00:00:21 -sameq -b 2k -r 0.004 <span class="s2">&quot;{}.%01d.jpg&quot;</span> <span class="se">\;</span> </span></pre></div> </td></tr></table>
bash, ffmpeg, screenshot, video

Bash

viewtyconv(ffmpeg way)

1
2
3
4
5
#!/bin/bash
#
#by otzy_007 http://oprod.net 
#
ffmpeg -i $1 -vcodec mpeg4 -s 400x240 -acodec libmp3lame -ab 128k -vtag DIVX $2
https://snipt.net/embed/d5dcb0373e05254ed36c4cdfcd551ced/
https://snipt.net/raw/d5dcb0373e05254ed36c4cdfcd551ced/
d5dcb0373e05254ed36c4cdfcd551ced
bash
Bash
5
2016-09-22T19:11:51
True
False
False
/api/public/snipt/13624/
viewtyconvffmpeg-way
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c">#!/bin/bash</span> </span><span id="L-2"><a name="L-2"></a><span class="c">#</span> </span><span id="L-3"><a name="L-3"></a><span class="c">#by otzy_007 http://oprod.net </span> </span><span id="L-4"><a name="L-4"></a><span class="c">#</span> </span><span id="L-5"><a name="L-5"></a>ffmpeg -i <span class="nv">$1</span> -vcodec mpeg4 -s 400x240 -acodec libmp3lame -ab 128k -vtag DIVX <span class="nv">$2</span> </span></pre></div> </td></tr></table>
convert, ffmpeg, ku990, lg, video, vietwtyconv, viewty
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.