Difference between revisions of "Ffmpeg"
(Created page with "=ffmpeg= ==Creating video thumbnails using ffmpeg== If we want to host video on website then we can also display thumbnail(s) related to video to give idea of to viewers abo...") |
m |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Sound and video related tools]] > [[Ffmpeg]] | |||
==Creating video thumbnails using ffmpeg== | ==Creating video thumbnails using ffmpeg== | ||
Line 22: | Line 22: | ||
</pre> | </pre> | ||
after replacing .mp4 at both places with appropriate extension. | after replacing .mp4 at both places with appropriate extension. | ||
==Converting ogg files to mp3 using ffmpeg== | |||
ffmpeg can be used to convert ogg audio files to mp3 files using: | |||
<pre> | |||
for name in *.ogg; do ffmpeg -i "$name" -ab 128k "${name/.ogg/.mp3}"; done; | |||
</pre> | |||
Ref: http://linuxforums.org.uk/index.php?topic=9836.0 | |||
==Converting wmv to avi using ffmpeg== | |||
To convert wmv to avi using ffmpeg use: | |||
<pre> | |||
ffmpeg -i input.wmv output.avi | |||
</pre> | |||
Note that it may not work for files that use MSS2 format. | |||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Sound and video related tools]] > [[Ffmpeg]] |
Latest revision as of 13:37, 24 August 2022
Home > CentOS > CentOS 6.x > Sound and video related tools > Ffmpeg
Creating video thumbnails using ffmpeg
If we want to host video on website then we can also display thumbnail(s) related to video to give idea of to viewers about the video. To create thumbnails for video we can use ffmpeg. The command that can be used is
ffmpeg -itsoffset -4 -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg
Note that:
- We can completely ignore option '-itsoffset -4' if we want thumbnail of first frame in video. We can also change the parameter 4 which is in seconds.
- 'test.avi' is the name of video file, it can also be .mpg or .mpeg etc.
- '-s 320x240' is used to specify dimensions of thumbnail.
- 'test.jpg' is the name of output file.
Learned from http://blog.prashanthellina.com/2008/03/29/creating-video-thumbnails-using-ffmpeg/
Tip
To use the above technique on number of videos one can use following script
for FILE1 in *.mp4; do ffmpeg -itsoffset -4 -i $FILE1 -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 ${FILE1/%.mp4/.jpg}; done
after replacing .mp4 at both places with appropriate extension.
Converting ogg files to mp3 using ffmpeg
ffmpeg can be used to convert ogg audio files to mp3 files using:
for name in *.ogg; do ffmpeg -i "$name" -ab 128k "${name/.ogg/.mp3}"; done;
Ref: http://linuxforums.org.uk/index.php?topic=9836.0
Converting wmv to avi using ffmpeg
To convert wmv to avi using ffmpeg use:
ffmpeg -i input.wmv output.avi
Note that it may not work for files that use MSS2 format.
Home > CentOS > CentOS 6.x > Sound and video related tools > Ffmpeg