Ben Chuanlong Du's Blog

It is never too late to learn.

Tips on FFmpeg

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

It is suggested that you use OpenCV for Python and moviepy (instead of FFmpeg) to manipulate multimedia.

  1. extrac audio from video

  2. convert between different formats of audios

Record Screen

The command below record screen into a MP4 video named out.mp4 in Linux.

ffmpeg -f x11grab -r 25 -s cif -i :0.0 $(date +%m%d%H%M%S).mp4

The command below record screen into a MP4 video named out.mp4 in macOS.

ffmpeg -f avfoundation -i "1" -pix_fmt yuv420p -r 25 $(date +%m%d%H%M%S).mp4

Convert Video Files

Convert a MOV video file to a MP4 video file.

ffmpeg -i my-video.mov -vcodec h264 -acodec mp2 my-video.mp4

References

Comments