Created
October 20, 2011 13:22
-
-
Save dr-r3d/1301131 to your computer and use it in GitHub Desktop.
ogv not found
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
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