Home / Media
(Ignore this section.)
-crf 23
: Constant rate factor. Defaults to 23. Set to 0 for lossless video.(Including V4L2 for Linux distros.)
sudo apt install ffmpeg v4l-utils
sudo pacman -S ffmpeg v4l-utils
v4l2-ctl --list-devices
/dev/video<n>
for the same device, only one of them provides the correct video feed.v4l2-ctl -<n> --all
(for /dev/video<n>
)
ffmpeg -list_devices true -f dshow -i dummy
ffplay <dev-or-url>
while true; do ffmpeg -hide_banner -loglevel error -i http://localhost:5555/ -c copy -map 0 -f segment -segment_time $((5*60)) -segment_format mp4 -strftime 1 "%Y-%m-%d_%H-%M-%S.mp4"; sleep 1; done
ffmpeg -i http://localhost:5555/ -filter:v "setpts=0.1*PTS" -an out.mkv
Useful e.g. to recombine video files for recorders which automatically splits the recording.
ffmpeg -f concat -safe 0 -i <(for f in ./*.MP4; do echo "file '$PWD/$f'"; done) -c copy output.MP4
.MP4
.Useful e.g. to change the framerate of a video-only timelapse video.
See: Speeding up/slowing down video (FFmpeg)
ffmpeg -i input.mp4 -map 0:v -c:v copy -bsf:v h264_mp4toannexb raw.h264
ffmpeg -i input.mp4 -map 0:v -c:v copy -bsf:v hevc_mp4toannexb raw.h265
ffmpeg -fflags +genpts -r <fps> -i raw.h264 -c:v copy output.mp4
(for desired frame rate fps
)