📜 ⬆️ ⬇️

Ffmpeg for every day

14 daily applications of FFmpeg.
  1. Extracting information from a video file:
    ffmpeg -i sample.avi
  2. "Gluing" images in the video:
    ffmpeg -f image2 -i image%d.jpg video.mpg
    All pictures from the current directory with file names image1.jpg , image2.jpg , etc. will be converted into one video.mpg video.
  3. The decomposition of the video sequence into frames:
    ffmpeg -i video.mpg image%d.jpg
    The image1.jpg , image2.jpg , etc. files will be generated. Supported graphic formats: PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI.
  4. Encoding video for Apple iPod / iPhone:
    ffmpeg -i source_video.avi input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X final_video.mp4
  5. For Sony PSP:
    ffmpeg -i source_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac final_video.mp4
  6. Extract audio from a video file and then save it in MP3 format:
    ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3
  7. Convert WAV to MP3:
    ffmpeg -i son_original.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 son_final.mp3
  8. AVI to MPG:
    ffmpeg -i video_original.avi video_final.mpg
  9. MPG to AVI:
    ffmpeg -i video_original.mpg video_final.avi
  10. Convert an AVI file to an uncompressed animated GIF:
    ffmpeg -i video_original.avi gif_anime.gif
  11. Mixing audio and video stream into one resulting file:
    ffmpeg -i son.wav -i video_original.avi video_final.mpg
  12. Convert AVI to FLV:
    ffmpeg -i video_original.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_final.flv
  13. FLV to AVI:
    ffmpeg -i video_original.flv -ab 56 -ar 44100 -b 200 -s 320x240 video_final.avi
  14. FLAC to MP3:
    ffmpeg -i audio_original.flac -ab 320k -ac 2 -ar 48000 audio_final.mp3

')

Source: https://habr.com/ru/post/43838/


All Articles