Last active
August 29, 2015 14:05
-
-
Save Stephenitis/8e7be71ab5fee4a79c01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# declare stack | |
stack "ffmpeg-2.3" | |
# this is the important part that will include ffmpeg-2.3 gpac 0.51 | |
# OS - Ubuntu 12.04.5 | |
# check out all the installed libraries on this stack here | |
# declare runtime to use | |
runtime "ruby" | |
# declare a runtime our FFMPEG stack supports | |
# -Python | |
# -Node | |
# -Ruby | |
# -Php | |
# -Binary (run a shell script) | |
# declare a executable that will do your video processing | |
exec "optimize_video.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
movie = FFMPEG::Movie.new("https://archive.org/download/LeafroyaltyFreeStockVideo/Leaf.mp4") | |
movie.duration # 7.5 (duration of the movie in seconds) | |
movie.bitrate # 481 (bitrate in kb/s) | |
movie.size # 455546 (filesize in bytes) | |
movie.video_stream # "h264, yuv420p, 640x480 [PAR 1:1 DAR 4:3], 371 kb/s, 16.75 fps, 15 tbr, 600 tbn, 1200 tbc" (raw video stream info) | |
movie.video_codec # "h264" | |
movie.colorspace # "yuv420p" | |
movie.resolution # "640x480" | |
movie.width # 640 (width of the movie in pixels) | |
movie.height # 480 (height of the movie in pixels) | |
movie.frame_rate # 16.72 (frames per second) | |
movie.audio_stream # "aac, 44100 Hz, stereo, s16, 75 kb/s" (raw audio stream info) | |
movie.audio_codec # "aac" | |
movie.audio_sample_rate # 44100 | |
movie.audio_channels # 2 | |
movie.valid? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment