Differences

This shows you the differences between two versions of the page.

Link to this comparison view

media_handling [2019/03/31 14:49] (current)
Line 1: Line 1:
 +======= Media Handling =======
 +
 +Handling media files such as pictures and videos is a task that pops up often
 +and Linux has a host of great CLI tools for doing so very quickly and easily.
 +Mastering these tools will allow you to do things like, flipping an ''​%%.MOV%%''​
 +video or scrubbing the exif data of a photo, or resizing a photo to the best
 +resultion under a set size in seconds without interrupting what you were
 +actually trying to accomplish.
 +
 +The following are commands for tasks I have ran into.
 +
 +===== Flipping Videos =====
 +
 +To vertically flip a video and retain its stream settings use a view filter in
 +ffmpeg by doing the following:
 +
 +<code bash>
 +ffmpeg -i in.MOV -vf "​vflip"​ -c:a copy out.MOV
 +</​code>​
 +
 +To flip a video file that has been flipped to the correct orientation by use of
 +the exif orientation value, run the command twice.
 +
 +<code bash>
 +ffmpeg -i in.MOV -vf "​vflip"​ -c:a copy out1.MOV
 +ffmpeg -i out1.MOV -vf "​vflip"​ -c:a copy out.MOV
 +rm out1.mov
 +</​code>​
 +
 +===== Rotating Photos =====
 +
 +When rotating photos its also usually desirable to dump the exif orientation
 +tag. To do this:
 +
 +<code bash>
 +exiftool -Orientation= /​path/​to/​file/​or/​dirs -overwrite_original
 +convert file.jpg -rotate -90 out.jpg
 +</​code>​
  
  • media_handling.txt
  • Last modified: 2019/03/31 14:49
  • (external edit)