Skip to content

Instantly share code, notes, and snippets.

@dr-r3d
Created October 20, 2011 13:22
Show Gist options
  • Save dr-r3d/1301131 to your computer and use it in GitHub Desktop.
Save dr-r3d/1301131 to your computer and use it in GitHub Desktop.
ogv not found
def convert_to_ogv
remote_url = model.send("remote_#{mounted_as}_url")
if should_process_remote?(remote_url)
download_from_remote_location(remote_url)
else
directory = File.dirname( current_path )
tmpfile = File.join(directory, "tmpfile.mp3")
###########################################
this should be tmpfile.mp4
ogv_tmpfile = File.join(directory, "tmpfile.ogg")
##########################################
this should be tmpfile.ogv
FileUtils.move(current_path, tmpfile)
`ffmpeg2theora -v 7 #{tmpfile} -o #{ogv_tmpfile}`
`touch #{ogv_tmpfile}` # in case conversion was not successful
FileUtils.move(ogv_tmpfile, current_path)
FileUtils.remove(tmpfile)
end
file.content_type = "video/ogg"
#############################################
this should be video/ogv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment