Skip to content

Instantly share code, notes, and snippets.

@culurciello
Created June 13, 2015 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save culurciello/38db6206a025039130f7 to your computer and use it in GitHub Desktop.
Save culurciello/38db6206a025039130f7 to your computer and use it in GitHub Desktop.
to resize 1080p videos:
ffmpeg -i pool.mp4 -vf scale=640:360 pool-small.mp4
to match odroid fps (12fps): need to speed up video:
https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
1:
ffmpeg -i dog.mp4 -vf scale=640:360 -filter:v "setpts=0.5*PTS" dog-2x.mp4
because it does not scale with this command, so we need to do more:
2:
ffmpeg -i dog-2x.mp4 -vf scale=640:360 dog-small.mp4
———
to create a folder of images from a video with scaling:
http://linuxers.org/tutorial/how-extract-images-video-using-ffmpeg
ffmpeg -i pool.mp4 -vf scale=640:360 -f image2 scratch/image-%3d.jpeg
MOV to MP4 without audio:
ffmpeg -i [input_file] -an [output_file]
remove just audio:
ffmpeg -i [input_file] -vcodec copy -an [output_file]
STREAM MOVIE:
http://www.alkannoide.com/2013/07/04/play-with-ffserver-a-quick-overview/
ffserver -d
ffmpeg -i /Users/eugenioculurciello/Movies/The\ Lego\ Movie\ \(2014\)\ \[1080p\]/The.Lego.Movie.2014.1080p.BluRay.x264.YIFY.mp4 http://localhost:8080/feed1.ffm
movie from webcam OS X:
ffmpeg -v verbose -f avfoundation -i "0" test.mp4
https://trac.ffmpeg.org/wiki/Capture/Desktop
capture to frames directly:
ffmpeg -v verbose -f avfoundation -i "0" -r 10 -s hd480 image-%3d.jpg
STREAM WEBCAM!!!!
run ffserver:
ffserver -d &
http://blog.oscarliang.net/webcam-streaming-video-raspberry-pi-via-browser/
ffmpeg -f avfoundation -i "0" http://localhost/webcam.ffm
from:
https://trac.ffmpeg.org/wiki/Capture/Webcam
— Play a file with captions on OS X:
/Applications/VLC.app/Contents/MacOS/VLC video.mp4 --sub-file=detections.vtt
CREATE MOVIE FROM IMAGES:
ffmpeg -framerate 1/5 -i img%02d.jpg -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment