Skip to content

Instantly share code, notes, and snippets.

@peroon
Last active November 13, 2015 07:43
Show Gist options
  • Save peroon/7fd54cf9cd7e251c47af to your computer and use it in GitHub Desktop.
Save peroon/7fd54cf9cd7e251c47af to your computer and use it in GitHub Desktop.
動画作成コード ffmpeg.rb
Dir.chdir("VR_Sequence")
def ffmpeg(start_frame, end_frame)
vframe = end_frame - start_frame - 1
direction = "ffmpeg -f image2 -r 60 -start_number #{start_frame} -i img%05d.png -vframes #{vframe} -r 60 -an -vcodec libx264 -y -pix_fmt yuv420p #{start_frame}-#{end_frame}.mp4"
p direction
system(direction)
end
startf = 4; endf = startf + 6000 - 1
ffmpeg(startf, endf)
#2フレ捨てる
startf = endf + 1 + 2; endf = startf + 3600 - 1
ffmpeg(startf, endf)
#2フレ捨てる
startf = endf + 1 + 2; endf = startf + 28 * 60 - 1
ffmpeg(startf, endf)
#2フレ捨てる
startf = endf + 1 + 2; endf = 14400
ffmpeg(startf, endf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment