ffmpeg -i path/inputVideo.mp4 -vcodec h264 -acodec aac outputVideo.mp4
Convert mp4 to HLS format video
ffmpeg -i input.mp4 -profile:v baseline -level 3.0 -s 640x360 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls index.m3u8
Untuk loop video dalam folder yg ada file name
for i in *.mp4;
do name=`echo new_$i | cut -d'.' -f1`;
echo $name;
ffmpeg -i "$i" -vcodec h264 -acodec aac "${name}_new.mp4";
done
ffmpeg -i input.avi -vf scale=320:240 output.avi
Record on mac webcam using ffmpeg
ffmpeg -f avfoundation -framerate 30 -i 0:0 -pix_fmt yuv420p output.mov
Generate image from video every 1s (fps)
ffmpeg -i input.mp4 -vf fps=1 out%d.png
Generate image from video every frame
ffmpeg -i video.webm thumb%04d.jpg -hide_banner
ffmpeg -i [input video] -codec copy -f flv rtmp://a.rtmp.youtube.com/live2/[key streaming]
Capture screen stream to yotube
ffmpeg -framerate 30 -video_size 1920x1080 -f x11grab -i :1 -f pulse -i default -c:v libx264 -b:v 5000k -maxrate 5000k -bufsize 10000k -g 60 -vf format=yuv420p -c:a aac -b:a 128k -f flv rtmp://a.rtmp.youtube.com/live2/stream_key
Get all available input devices including screens ready to be captured.
ffmpeg -f avfoundation -list_devices true -i ""
Once you've figured out the device index corresponding to the screen to be captured, use:
ffmpeg -framerate 30 -video_size 1280x720 -f avfoundation -i "<screen device index>:<audio device index>" output.mp4