Log in | Register
Forum > Site Discussion > Thread

Editing and rotating videos losslessly

Aug 26, 2019 - permalink
There are a lot of ways to download videos from Youtube and other sites, I generally use the Video DownloadHelper Firefox extension or the Internet Download Manager desktop app/extension myself, depending on the site (Instagram videos are a special case- see this thread).

After downloading, if the video needs to be cut down in length, combined with other segments, or rotated correctly, I like to do it without lossy re-encoding of the video stream if possible, since that lowers the original video quality.

Rotating/Cropping-
For lossless rotation of videos filmed sideways and such, the best thing I've found is the free program FFmpeg Batch, which is basically a graphical frontend for the FFmpeg command-line suite, and quite powerful (it comes with its own version of FFmpeg so you don't need to download anything else).  The default rotation parameters it comes with also do format conversion, but I found out you can use the parameters:

-metadata:s:v rotate="-90" -codec copy

instead, which seems to work fine without messing with the original data.  The "-90" (90 degree clockwise rotation) can be changed to "-180" or "-270" depending on how far the video needs to be rotated.  If you're working with .mp4 files, make sure the format field is set to mp4 also.

FFmpeg Batch can be used to do pretty much anything FFmpeg can, including non-lossless stuff like cropping, example parameters for cropping a video: 

-filter:v "crop=640:420:0:0" -crf 10

where 640x420 is the final size you want and 0:0 (x:y) is the starting point, top-left; it would be 640:420:0:200 if you wanted to start the crop box 200 pixels down, for instance.  The "-crf 10" part sets a Constant Rate Factor of 10 which should be nearly lossless quality, and is a useful thing to add for any function that isn't inherently lossless, i.e. not the rotation command above.

Trimming/Combining Videos-
For losslessly trimming down the length of a video or combining multiple videos into one (the latter is useful for Instagram Stories, where often a single video is spread into multiple 15-second clips), I like the program Machete.  It's paid, but only costs $20 (there's a free version, but it doesn't work with mp4 files).  The only limitation is that you have to cut the videos at the keyframe points, which aren't always exactly where you want them, but they're usually close enough.  A good free alternative to Machete is Avidemux, just be sure it's set to copy mode, use the keyframe buttons to select the edit points, and have the output format set to MP4 (if that's what you're editing).  This page lists a bunch of other alternative programs.

EDIT:  Added a free alternative to Machete for trimming, and more detail in the cropping section.
Chainer
Aug 26, 2019 - permalink
Thanks, stickied
tamarok
Jan 04, 2021 - permalink

Another app worth checking out is Handbrake, which is available for macOS, Linux and Windows. It is free and open source.

Jan 04, 2021 - permalink

I tried Handbrake a while ago, but from what I remember it always re-encodes and doesn't really do lossless conversions even when it should be possible (i.e. moving a video stream from an .mkv container format to .mp4, etc)

tamarok
Jan 05, 2021 - permalink

That's true, though it does afford many people a relatively easy way convert. Tools like ffmpeg will offer better options, but the need for command-line knowledge will put it out of the reach of many people.

Mar 17, 2021 - edited Mar 17, 2021 - permalink

Does anyone at GWM ever crop or reformat those tall skinny videos that are increasingly being downloaded from tik-tok? When downloaded as is, the frames are so skinny the subjects hardly have room for any kind of horizontal movements like flexing unless the camera is an undesirable long way from the action. They are so tall they can't be enlarged on GWM pages that are mainly horizontal; indeed most of them appear to be effectively shrunk to fit. This might not be such an issue were it not for the fact that tik-tok is becoming such a dominant source of videos for GWM, the older (and, for me at least, preferable) enlargeable wide angle format is becoming something of an endangered species. Unfortunately cropping or reformatting tik-tok videos won't make them any wider, but it can make them a lot less tall and maybe more enlargeable.

tamarok
Mar 17, 2021 - edited Mar 17, 2021 - permalink

I am not aware of staff doing so and if they did it would show as a staff member having uploaded the video. Tik-Tok videos as far as I am aware use 1080x1920 pixel dimensions.

The only ‘editing’ that you may see is change of the thumbnail to use another frame.

Edit: Just did a quick search and 1080x1920 is indeed the size to be used: https://tiktoktip.com/tiktok-size/

Mar 17, 2021 - permalink

If using another frame can involve vertically cropping all the waste space at the tops and/or bottoms of most tik-tok videos, I would certainly welcome that.

Mar 23, 2021 - permalink

Another app worth checking out is Handbrake, which is available for macOS, Linux and Windows. It is free and open source.

shoot i haven't used handbrake in like a decade lol maybe more

« first < prev Page 1 of 1 next > last »