Author Topic: GUI constraints on resizing and borders  (Read 437 times)

detly

  • Newbie
  • *
  • Posts: 6
GUI constraints on resizing and borders
« on: February 13, 2018, 04:51:58 AM »
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

  • Hero Member
  • *****
  • Posts: 2059
Re: GUI constraints on resizing and borders
« Reply #1 on: February 13, 2018, 08:51:33 AM »
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

  • Hero Member
  • *****
  • Posts: 2059
Re: GUI constraints on resizing and borders
« Reply #2 on: February 13, 2018, 07:50:37 PM »
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

  • Newbie
  • *
  • Posts: 6
Re: GUI constraints on resizing and borders
« Reply #3 on: February 13, 2018, 11:07:28 PM »
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

  • Hero Member
  • *****
  • Posts: 2059
Re: GUI constraints on resizing and borders
« Reply #4 on: February 14, 2018, 05:53:25 AM »
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.
« Last Edit: February 14, 2018, 05:55:30 AM by eumagga0x2a »

detly

  • Newbie
  • *
  • Posts: 6
Re: GUI constraints on resizing and borders
« Reply #5 on: February 14, 2018, 08:57:33 AM »
Is there a list of runtime dependencies (as Deb packages) for Ubuntu somewhere? All I can find on the wiki are build dependencies.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 2059
Re: GUI constraints on resizing and borders
« Reply #6 on: February 14, 2018, 09:24:20 AM »
It is assumed that runtime dependencies get installed as dependencies of the build dependencies.

detly

  • Newbie
  • *
  • Posts: 6
Re: GUI constraints on resizing and borders
« Reply #7 on: February 14, 2018, 09:44:13 AM »
Makes sense. Is it possible to run the built program without installing it above $HOME?

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 2059
Re: GUI constraints on resizing and borders
« Reply #8 on: February 14, 2018, 09:55:54 AM »
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

  • Newbie
  • *
  • Posts: 6
Re: GUI constraints on resizing and borders
« Reply #9 on: February 14, 2018, 10:05:00 AM »
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

  • Hero Member
  • *****
  • Posts: 2059
Re: GUI constraints on resizing and borders
« Reply #10 on: February 14, 2018, 10:15:46 AM »
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.
« Last Edit: February 14, 2018, 10:23:56 AM by eumagga0x2a »

detly

  • Newbie
  • *
  • Posts: 6
Re: GUI constraints on resizing and borders
« Reply #11 on: February 14, 2018, 10:25:19 AM »
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!