SHARE
TWEET

Untitled

a guest Jun 24th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env ruby
  2.  
  3. # Tool to convert Google motion JPGs (MVIMG) to MP4 video files.
  4. require 'exiftool'
  5.  
  6. files = Dir['*.jpg']
  7.  
  8. files.each do |file|
  9.   exif = Exiftool.new(file)
  10.   offset = exif[:micro_video_offset]
  11.   file_size = File.new(file).size
  12.  
  13.   start = file_size - offset
  14.  
  15.   out_file = File.basename(file, '.jpg') + '.mp4'
  16.   puts "Writing " + out_file
  17.   IO.copy_stream(file, out_file, file_size, start)
  18. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top