Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th July 2021, 10:50   #1  |  Link
kolamorx
Registered User
 
Join Date: Jun 2017
Posts: 47
Automatically pan and scan 2.35:1 and 16:9 videos to 4:3?

I'm looking for a Windows tool, preferably free, that can automatically pan and scan 2.35:1 and 16:9 videos to 4:3.

Last edited by kolamorx; 25th July 2021 at 10:54.
kolamorx is offline   Reply With Quote
Old 25th July 2021, 12:23   #2  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Out of interest... Why?

Nobody manufacturers 4:3 display gear anymore...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 27th July 2021, 12:10   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
PotPlayer has option to "Stretch by keeping aspect ratio" which will do as you require, eg
video 2.35:1 -> 4:3 monitor
video 4:3 -> 2.35:1 monitor

Works quite well with 2.35:1 < - > 16:9 OR 16:9 < - > 4:3,
2.35 < - > 4:3 might be a bit much to expect fair results [but it will do it].

Perhaps other players have similar.

EDIT: It actually stretches 1 dimension, and crops the other, to fit the monitor.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th July 2021 at 13:48.
StainlessS is offline   Reply With Quote
Old 28th July 2021, 20:45   #4  |  Link
therube
Registered User
 
Join Date: Aug 2013
Posts: 191
I don't know about "pan & scan", per se, but using ffplay, you can do stuff like forcing playback at a particular scale.
Code:
ffplay video.avi -fv scale=800:600
FFmpeg - Change resolution of the video with aspect ratio

FFmpeg.

(ffmpeg/ffplay/ffprobe... are command line tools.)

GUI's exist that allow switching aspect ratios on-the-fly.
MPUI-hcb
mpv.net additionally does pan & scan (via GUI) - where content may actually be "cut" away. Maybe something can be automated?
therube is offline   Reply With Quote
Old 4th August 2021, 00:37   #5  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Quote:
Originally Posted by kolamorx View Post
I'm looking for a Windows tool...that can automatically pan and scan 2.35:1 and 16:9 videos to 4:3.
There's no such thing. Do you even know what's involved?

https://en.wikipedia.org/wiki/Pan_and_scan

Do you even understand what an idiotic idea it is?

https://www.youtube.com/watch?v=5m1-pP1-5K8
manono is offline   Reply With Quote
Old 12th August 2021, 15:38   #6  |  Link
pandy
Registered User
 
Join Date: Mar 2006
Posts: 1,049
As i agree with all comments about quite bizzare requirements (with respect to current technology state) then i can only say that for sure MPEG-2 support such feature called pan vector in both direction (i.e. X & Y), but even if pan vector information exist then decoder may ignore it (usually it is ignored) - i know only few products fully supporting pan vector information (by fully i mean both X&Y direction updated in real time i.e. on frame basis so pan window may be smoothly moved across video scene). In past i've used HCEnc to create such content - it is quite straightforward on this - you need prepare list of pan vectors or do this manually within HCEnc GUI. not sure about panvector status in H.264 and i'm almost 100% sure that H.265 tailored for 16:9 may be completely incapable to do panvector.
pandy is offline   Reply With Quote
Old 25th August 2021, 22:59   #7  |  Link
kolamorx
Registered User
 
Join Date: Jun 2017
Posts: 47
What is the best way to manually pan and scan 2.35:1 and 16:9 videos to 4:3?
kolamorx is offline   Reply With Quote
Old 28th August 2021, 13:36   #8  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,531
I would (and do) use Vegas' Panorama/Cropping for that.
Almost on daily basis, after stabilisation.
One can conveniently add keyframes at the desired moment on the timeline, suggest 6 different acceleration curves around those keyframes (like linear, ease in/ease out and 3 more) having the desired framing moved in desired WYSIWYG manner across the source.
All planar resizing is there: shifting, zooming in and out, rotation.
And of course one can implement that as AviSynth crop script, needs just a bit more patience X-}}
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 28th August 2021 at 13:46.
Emulgator is offline   Reply With Quote
Old 3rd October 2021, 04:00   #9  |  Link
kolamorx
Registered User
 
Join Date: Jun 2017
Posts: 47
I've came across Adobe Premiere Pro's feature "Auto Reframe" which supposed to automatically pan and scan videos.
However, there are two problems that prevent me from using this feature:
1. This is very expensive.
2. My PC doesn't match the minimum system requirements.
kolamorx is offline   Reply With Quote
Old 3rd October 2021, 06:49   #10  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,048
AVIsynth has a crop() filter.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 3rd October 2021, 21:51   #11  |  Link
Richard1485
Guest
 
Posts: n/a
Quote:
Originally Posted by kolamorx View Post
What is the best way to manually pan and scan 2.35:1 and 16:9 videos to 4:3?
One way is to use AviSynth's Trim() filter to break the video up into shots and then use Crop() with appropriate values for each shot; however (1) this is a lot of work (2) with true pan and scan the part of the image being extracted often varies within each shot, for which you'd need to use something like Animate().That's the panning part.


Last edited by Richard1485; 3rd October 2021 at 22:02.
  Reply With Quote
Old 4th October 2021, 08:01   #12  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
In addition to Richard1485's suggestion, and this is coming from someone who's panned and scanned with Avisynth a few times, it can be incredibly tedious.

In my case I panned and scanned a couple of 4:3 sources to 16:9. If I was doing it again, which I doubt I will, I'd consider running scene change detection on the source first, then armed with the list of frame numbers for scene changes, I'd use them to add the Trims to a script, with each instance of Trim beginning on a scene change. That's where they'll be most of the time anyway and it could prevent much of the soul crushing tedium.... well, maybe not prevent it, but clamp it to unrelenting boredom.

When I tortured myself panning and scanning with Avisynth, I had to determine the cropping for each section and add it to each one along with the resizing. Often I didn't have to change the total cropping, only distribute it differently. One scene might've required 40 pixels off the bottom and 44 from the top to extract the desired picture. The next scene might need 56 from the bottom and 28 from the top, but as long as the total cropping doesn't change you only have to make sure you're cropping the picture to the correct aspect ratio once. Unfortunately though, it's only that easy in a world made of chocolate and where there's also an abundant supply of fairly dust.

Panning and scanning with just the crop filter and a resizer is do-able, but don't let that fool you into thinking it mightn't be completely mental, because it's mental.

I guess that was a longer than usual Segway into a plug for CropResize, but for panning and scanning it should reduce the mental to a more tolerable level. CropResize won't let you distort the picture so there's no need to keep worrying about aspect ratio. For panning and scanning to 4:3 it works something like this:

You'd determine the minimum cropping, or the amount required to remove any black or crud at the edges. Making something up here, for a 1080p source with letterbox borders that might be Crop(2, 142, -4, -140).

For CropResize it'd be (also specifying 4:3 output dimensions).

CropResize(960,720, 2,142,-4,-140)

It'll apply the specified cropping, then crop whatever extra is required for the remaining picture to have a 4:3 aspect ratio. For the above example, it'll obviously need to crop extra from each side for 4:3.
For panning and scanning, if the next scene requires different cropping, for example to move the retained picture area 34 pixels towards the right of the frame:

CropResize(960,720, 36,142,-4,-140)

After applying the cropping above, the script will crop an additional amount from each side as required to output 4:3.

There's a global GCropResize function. Specify the output dimensions along with your default cropping, and each CropResize instance will apply the cropping along with any other arguments added to GCropResize... unless of course you tell CropResize to do something different.

Each CropResize instance can create a cropping preview, and it'll look a little like the pic in Richard1485's post above, except with any luck you'll only ever need to adjust the cropping on the first frame of scene, then adjust it as required on the first frame of the next one and so on.....
Sorry.... I couldn't resist that little joke... but it's so much easier when it works that way.
You can't see a cropping change if it's on a scene change, but in the middle of one....
Now I think about, for the DVDs I panned and scanned I sometimes used "compromise cropping" for a whole scene rather than try to change it mid-scene if I could get away with it.

Anyway, using a bunch of Trims with CropResize might look like this, plus hundreds more to manually pan and scan.

Vid = last # or something
GCropResize(960,720, 2,142,-4,-140, CPreview=1)

Vid.Trim(0, 1999).CropResize() ++ \
Vid.Trim(2000, 2999).CR(0,0, 36,142,-4,-140) ++ \
Vid.Trim(3000, 3999).CR() ++ \
Vid.Trim(4000, 4999).CR(0,0, 2,142,-48,-140)

Last edited by hello_hello; 4th October 2021 at 14:41.
hello_hello is offline   Reply With Quote
Old 4th October 2021, 08:57   #13  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by hello_hello View Post
this is coming from someone who's panned and scanned with Avisynth a few times, it can be incredibly tedious.
I have to agree. Anyone remembers this from 2015? https://forum.doom9.org/showthread.php?t=172566

I eventually ended up doing the whole series manually in Avisynth for the company I was working for at the time (Viewster) and... it was a nightmare, honestly.
FranceBB is offline   Reply With Quote
Old 4th October 2021, 13:04   #14  |  Link
Richard1485
Guest
 
Posts: n/a
Quote:
Originally Posted by FranceBB View Post
I eventually ended up doing the whole series manually in Avisynth for the company I was working for at the time (Viewster) and... it was a nightmare, honestly.
It must have been. A whole series! I've done manual P&S myself, and "tedious" doesn't even begin to describe the process, so I can't even imagine doing a whole series. I hope they gave you Viewster's Millions for that job.
  Reply With Quote
Old 4th October 2021, 20:33   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Just floating an idea here, it may [probably] come to nothing but I wanna know how it sounds to others.
[below Posted by Richard1485]


I have no idea how to do this, [I aint a windows progger],
but I guess it would simplify the pan / scan if you had a movable crop box as in the image, but controlled via keyboard, left and right [or joystick].
Scan entire movie and somehow 'plant' crop box positions every now and then, recorded in some fashion.
2nd scan to tween crop box positions [somehow].
3rd scan to do the business.

Or is that too simplistic.

EDIT: How do professional systems do it?

EDIT: Could mostly [MAYBE] be done in Avisynth, if I could read keyboard cursor keys, any plugin to do that ?
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 4th October 2021 at 20:39.
StainlessS is offline   Reply With Quote
Old 4th October 2021, 21:34   #16  |  Link
Richard1485
Guest
 
Posts: n/a
Quote:
Originally Posted by StainlessS View Post
but I guess it would simplify the pan / scan if you had a movable crop box as in the image, but controlled via keyboard, left and right [or joystick].
Yeah, it must be possible, because it's similar to what AVSEdit/AVSPMod achieved (not that I ever really used either of them). It's like having a slider (or a pair of sliders: X and Y axis) that copies its value(s) to the script, along with the current frame, if you hit a key.

Come to think of it, there was a Pan filter for VirtualDub years ago. I don't know how easy to use it was, and I don't have Wine installed to check it out, but that might be the easiest option.
  Reply With Quote
Old 4th October 2021, 22:41   #17  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Thanks R1485, downed AvsEdit Plus + source,
I used original AvsEdit for years and hated it, (think that one was written in delphi [or maybe VB], not sure), Plus is in C#
so probably totally different to use.
Dont know C# but i'll take a look.

I think I have source [somewhere] for some plugin that has a popup dialog box, maybe I can use that as start point
for plug that allows for keyboard communication with AVS script.

EDIT: Having totally appalling connections issues today.
EDIT: Particular problems connecting to google or USA, wonder if related to Facebook, Instagram and WhatsApp,
all being down for millions, at the moment [as reported in press].

Quote:
The drop-out began around 4.30pm and problems continued to be reported around the world into Monday night,
suggesting the platforms may have been offline for all 2 billion people who use them each day.
Probably down to that ruddy FaceBook thing being connected to everything whether you use it or not.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 4th October 2021 at 23:08.
StainlessS is offline   Reply With Quote
Old 5th October 2021, 06:40   #18  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by StainlessS View Post
Just floating an idea here, it may [probably] come to nothing but I wanna know how it sounds to others[/IMG]

I have no idea how to do this, [I aint a windows progger],
but I guess it would simplify the pan / scan if you had a movable crop box as in the image, but controlled via keyboard, left and right [or joystick].
Scan entire movie and somehow 'plant' crop box positions every now and then, recorded in some fashion.
2nd scan to tween crop box positions [somehow].
3rd scan to do the business.
You'd probably want it to zoom too. Based on my limited experience, sometimes moving the cropped area around isn't enough. For example, there might be something happening on each side of the frame (two people talking?), and moving the cropped area fully to the left might only crop half of what's on the right. Sometimes it's better to also zoom in until the right side is fully cropped.

I recall not being all that happy with the result when using Animate to adjust the cropped area. Sometimes the panning looked quite jittery so I tried to avoid it if possible.....

Well ^%&$ me! Why does every Animate/Crop example on the Avisynth wiki use Crop() to do the cropping??
Between the previous paragraph and this one I had a play with Animate, and after 10 years of using Avisynth I finally know to ask the question..... Why?? It's so obvious now I want to bang my head on the desk for a while......

Nice and smooth (a 300 pixel shift over 150 frames).

Code:
v = Version.Trim(0,149)
Animate(v, 0, 149, "Crop", 
\    0, 0, 64, 0,
\  300, 0, 64, 0)
Not so much (a 300 pixel shift over 169 frames).

Code:
v = Version.Trim(0,169)
Animate(v, 0, 169, "Crop", 
\    0, 0, 64, 0,
\  300, 0, 64, 0)
But when the cropping is of a sub-pixel nature....

Code:
v = Version.Trim(0,169)
Animate(v, 0, 169, "Spline36Resize", 
\    64,104, 0, 0, 64.0, 0,
\  64,104, 300.0, 0, 64.0, 0)
Admittedly there's a truck load of monkey-see, monkey-do, for which I take full responsibility, but I could've been using Animate all this time??? Not to mention the zoom examples. It seems a few decimal points can make quite a difference there too.

As a side note, there's no shortage of artefacts when I try the zoom example on the Avisynth wiki. If I use BiliearResize it's fine, but unfortunately my poor little monkey brain doesn't understand why.

Code:
c = last.CropResize(320,240) # the source should be 320x240
Animate(c, 100,200,"BicubicResize", 
\  320,240,0,0,320,240, 
\  320,240,120,90,80,60)
As another side note, I guess I'll be updating CropResize to accept float values for cropping sometime soon.
hello_hello is offline   Reply With Quote
Old 5th October 2021, 12:02   #19  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Well ^%&$ me! Why does every Animate/Crop example on the Avisynth wiki use Crop() to do the cropping??
Yeah, I think there was a thread involving RaffRiff42 [and myself I think] doing the animate thing with resize ["crop" is just shorter to use in post].
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 5th October 2021, 14:19   #20  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
The Animate page on the Avisynth wiki really should make mention of resizer cropping and ensuring the cropping values are float, in my opinion.

The problem with the zoom example on the wiki seems to be caused by those pesky B and C arguments. I wonder why they're in that order?

From the zoom example on the Animate page.
BicubicResize(320,240, 120,90,80,60)



With b and c arguments.
BicubicResize(320,240, 0.33,0.33, 120,90,80,60)


Last edited by hello_hello; 5th October 2021 at 14:24.
hello_hello is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.