GUI constraints on resizing and borders

Started by detly, February 13, 2018, 04:51:58 AM

Previous topic - Next topic

detly

I'm using Avidemux 2.6 1:2.7.0-1~getdeb2~zesty from Getdeb under Ubuntu 17.04.

I have a video shot on mobile where the user rotated the phone halfway through (sigh). So I wanted to rotate only a section of the video, resizing and adding black borders to keep the size consistent. As far as I can tell, the only way to do this is to split the video into two files, run one through the filters, and append them for the final video — correct?

I have my first half: a 1920x1080 video that needs to be turned portrait. So I add a resize filter to make it 1080x608, and then go to add the border filter. By my calculation I should need 656 pixels on either side. But I cannot enter this into the border size controls on the GUI! They appear to have a maximum of 608 (the width of the video at that stage of the filters). Is there a reason for this eg. a constraint set by the encoder settings I'm using? (I ask so I don't try to bypass it and cause something else bad to happen later.) Or should I just use the border filter twice? Or is there some other way to achieve this?

I also thought about working around the non-integer-multiple problem (the ideal width is actually 607.5) by doubling the size, doing the rotate/border filters, then halving the size. However, I hit a similar problem with the resize control: I couldn't scale it higher than 2899px in either dimension. Again, is this constraint set because of some factor I'm not aware of? (I don't *really* care about the half a pixel, at this point it was a purely academic exercise.)

Finally, the split/rotate/merge approach is fine here, but for other videos with multiple rotations (sigh) I might want something smoother (eg. gradual rotation with pixels at image edge extended to frame edge). Is this something Avidemux can do, or do I need to look to other tools? Any recommendations? I tried to search, but there's a million hits for rotating entire videos and not much else.

Thanks!

eumagga0x2a

I see, at avidemux_plugins/ADM_videoFilters6/addBorder/ADM_vidAddBorder.cpp:182 and below we set the current width and height as upper limits for added borders. I'd suggest you first add borders to make the video square 1920x1920, then rotate (yes, the rotate filter can't be made partial), then resize it.

Rotate filter with support for arbitrary integer angles is available as an OpenGL Avidemuxb plugin, you must enable OpenGL in Avidemux for that.

Apart from that, I'd recommend to use Avidemux built from the current git master --> http://avidemux.org/smif/index.php/topic,18182.0.html

eumagga0x2a

Well, my incomplete steps would imply that you have to add borders twice. The limit seems to be arbitrary anyway, it must be just set to some sensible value instead of the default max value of a QSpinBox which is equal 99. I've increased it to 2160, this should be enough (you have to build Avidemux from the git master for that).

detly

That's fine, your first procedure worked a treat to do the rotation. Thanks. I put the intermediate (x264) stages into MKV containers, but I want to append and re-encode (to compress) the final x264 video into an MP4 container. Unfortunately I keep getting an error that the "video is too short/the video has been saved but seems to be incomplete", but I need to run it again to get the full error message. I'll post again when I have more details.

eumagga0x2a

#4
Quote from: detly on February 13, 2018, 11:07:28 PM
Unfortunately I keep getting an error that the "video is too short/the video has been saved but seems to be incomplete"

Please use a build from the current git master. It does a better job avoiding timestamp collisions which result in the error you encountered.

detly

Is there a list of runtime dependencies (as Deb packages) for Ubuntu somewhere? All I can find on the wiki are build dependencies.

eumagga0x2a

It is assumed that runtime dependencies get installed as dependencies of the build dependencies.

detly

Makes sense. Is it possible to run the built program without installing it above $HOME?

eumagga0x2a

Not trivially, you could create an appImage instead. Frankly speaking, I never looked into this. I don't use packaging in favor of using the --prefix=/usr/local option for bootStrap.bash script.

detly

I'm the opposite, I rarely install anything that's not managed by the package manager outside /home or /opt. I'll see what I can do. I had some problems with the --deb option before, but I think it was just dependency related...

eumagga0x2a

#10
debs (or rpms) created by CPack serve the single purpose to facilitate removal, they don't specify any dependencies.

For being installable into $HOME or /opt Avidemux must be built with relative library search path, never looked into this.

detly

That's alright, I made a dummy package with "equivs" to keep track of the build deps (and therefore the runtime deps). I'd just made an error in one of the package names. Now it's fixed, the debs install fine. And, even better, the full video encodes properly now!