Ffmpeg: Difference between revisions

From wikinotes
 
Line 47: Line 47:


</blockquote><!-- General Usage -->
</blockquote><!-- General Usage -->
== for html5 video ==
<source lang="bash">
ps>ffmpeg.exe -i in.mkv \
  -y -strict experimental \
  -acodec aac \
  -ac 2 \
  -ab 160k \
  -vcodec libx264 \
  -s 640x480 \
  -pix_fmt yuv420p \
  -preset slow \
  -profile:v baseline -level 30 \
  -maxrate 10000000 \
  -bufsize 10000000 \
  -b 1200k \
  -f mp4 \
  -threads 0 \
  out.mp4
</source>
<source lang="html5">
<!DOCTYPE html>
<html lang="en">
<body>
    <video width="640x480" controls>
        <source src="my/video.mp4" type="video/mp4">
        Your browser does not support the video tag.
    </video>
</body>
</html>
</source>


= filters =
= filters =

Latest revision as of 00:47, 23 July 2021

Tutorials

ffmpeg zero to hero https://ffmpegfromzerotohero.com/

General Usage

conversion/composition

ffmpeg <global-flags>  \
       <inputfile flags> -i /path/to/file.mov \
       <inputfile flags> -i /path/to/file.mov \
       <outputfile flags> /path/to/outputfile.mov

concatenation

Concat Demuxer (multiple files, same size/format, avoid re-encode).

echo "
file /path/fileA.mov
file /path/fileB.mov
" > /tmp/concat

ffmpeg -f concat -i /tmp/concat -c copy output.mov
ffmpeg -codecs    # list all codecs
ffmpeg -devices   # list all devices
ffmpeg -demuxers  # list all demuxers
ffmpeg -formats   # list all formats
ffmpeg -decoders  # list all deocders
ffmpeg -encoders  # list all encoders
ffmpeg -bsfs      # list all bit-stream filters

trim video

ffmpeg -i in.mkv -ss 00:00:00 -t 00:01:10 out.mkv

filters

Examples

ffmpeg for format
ffmpeg record from usb
ffmpeg record window