Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- # Tool to convert Google motion JPGs (MVIMG) to MP4 video files.
- require 'exiftool'
- files = Dir['*.jpg']
- files.each do |file|
- exif = Exiftool.new(file)
- offset = exif[:micro_video_offset]
- file_size = File.new(file).size
- start = file_size - offset
- out_file = File.basename(file, '.jpg') + '.mp4'
- puts "Writing " + out_file
- IO.copy_stream(file, out_file, file_size, start)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement