grimoire

personal wiki
git clone git://git.pyratebeard.net/grimoire.git
Log | Files | Refs

ffmpeg.md (835B)


      1 # ffmpeg
      2 
      3 ### extract audio from video
      4 ```
      5 ffmpeg -i input-video.mkv -q:a 0 -map a output-audio.mp3
      6 ```
      7 
      8 ### remove audio from a video
      9 ```
     10 ffmpeg -i video.mkv -c copy -an video-nosound.mkv
     11 ```
     12 
     13 ### record a video
     14 without audio
     15 ```
     16 ffmpeg -f x11grab -r 15 -i :0.0 -acodec libmp3lame -vcodec mpeg4 -ar 48000 -qscale 0 -framerate 24 outputvideo.avi
     17 ```
     18 
     19 with audio
     20 ```
     21 ffmpeg  -f alsa -ac 2 -i alsa -f x11grab -r 15 -i :0.0 -acodec libmp3lame -vcodec mpeg4 -ar 48000 -qscale 0 -framerate 24 outputvideo.avi
     22 ```
     23 
     24 ### convert video format
     25 ```
     26 ffmpeg -i videofile.mp4 videofile.webm
     27 ```
     28 
     29 ### adjust crf
     30 adjust constant rate factor to lower bit rate
     31 ```
     32 ffmpeg -i input.mp4 -vcodec libx264 -crf 20 output.mp4
     33 ```
     34 
     35 ### remove id3 tag image and metadata from audio file
     36 ```
     37 ffmpeg -i input.mp3 -vn -codec:a copy -map_metadata -1 output.mp3
     38 ```