Pixel Aspect Ratio Copy

Jazzman54 wrote on 11/23/2011, 4:34 AM
I have been given a set of clips from a client that have been saved from an old Panasonic camera. The clips are MPEG2 widescreen, but when I import them onto the timeline they preview and render as too narrow. I can correct the distortion by selecting the event properties and changing the pixel aspect ratio from 1:1 to PAL DVD widescreen (to match my project settings). I have tried other project screen settings but none seem to provide the correct result. The camera has recorded widescreen footage and will play totally correctly with media player.

Is there any way of repeating the pixel aspect ration change in all the events in a project. There are over 200 clips and I do not fancy changing all of them manually.
Thanks.

Comments

diverG wrote on 11/23/2011, 5:12 AM
The old Pana DX100 record 4:3 as stand and widescreen is an option. The widescreen is letterboxed from the camera and not true 16:9. May be your camera is similar.

Set the first clip and use' copy & patste attributes' for the rest of the timeline.

Geoff

Sys 1 Gig Z-890-UD, i9 285K @ 3.7 Ghz 64gb ram, 250gb SSD system, Plus 2x2Tb m2,  GTX 4060 ti, BMIP4k video out. Vegas 19 & 122(194), Edius 8.3WG and DVResolve19 Studio. Win 11 Pro. Latest graphic drivers.

Sys 2 Laptop 'Clevo' i7 6700K @ 3.0ghz, 16gb ram, 250gb SSd + 2Tb hdd,   nvidia 940 M graphics. VP17, Plus Edius 8WG Win 10 Pro (22H2) Resolve18

 

Jazzman54 wrote on 11/23/2011, 6:35 AM
Thanks for the reply Geoff, but copy and paste attributes does not work for the pixel aspect ratio. All occurrences of the same event are changed but it does not affect different events.
Ian.
diverG wrote on 11/23/2011, 9:02 AM
Have a look at this link.

http://www.sonycreativesoftware.com/forums/ShowMessage.asp?ForumID=4&MessageID=785377

A number of users had a problem with aspect ration using cineform in VP11. There is a post by johnmeyer towards the end of the thread which includes a script for changing the par. i've used it and it works.
It may just solve your problem.

Best of luck Geoff

Sys 1 Gig Z-890-UD, i9 285K @ 3.7 Ghz 64gb ram, 250gb SSD system, Plus 2x2Tb m2,  GTX 4060 ti, BMIP4k video out. Vegas 19 & 122(194), Edius 8.3WG and DVResolve19 Studio. Win 11 Pro. Latest graphic drivers.

Sys 2 Laptop 'Clevo' i7 6700K @ 3.0ghz, 16gb ram, 250gb SSd + 2Tb hdd,   nvidia 940 M graphics. VP17, Plus Edius 8WG Win 10 Pro (22H2) Resolve18

 

amendegw wrote on 11/23/2011, 9:24 AM
I've read and re-read the problem statement a couple of times and I'm not exactly sure what the issue is, but I've always been able to solve any aspect ratio problems by adjusting the following two settings.

1) In the event properties, there is a "Maintain Aspect Ratio" setting. This can be copied and pasted via the "Paste Event Attributes" - just tried and confirmed this.


2) and/or when rendering, check the "Stretch video to fill output frame size (do not letterbox)" setting.


Good Luck!
...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

altarvic wrote on 11/23/2011, 10:59 AM
Paste Event Attributes can only copy the event properties. Pixel Aspect is a media property.
You can try to find a free script for that or download Vegasaur for quick solution (you can freely use it within 30 days).
Quick Properties tool can do it for you (see screenshot)
jetdv wrote on 11/23/2011, 12:20 PM
Here's a script that will change the aspect ration. Just save it as AspectRation.js and edit it so that it sets it to the proper aspect. By default, this one is setting to an aspect ratio of 1.21.

//PixelAspect.js
import Sony.Vegas;

for (var currentTrack : Track in Vegas.Project.Tracks) {
if (currentTrack.IsVideo() == true) {
for (var currentEvent : VideoEvent in currentTrack.Events) {
if (currentEvent.Selected == true) {
VideoStream(new Media(currentEvent.ActiveTake.MediaPath).Streams.GetItemByMediaType(currentEvent.MediaType, currentEvent.ActiveTake.StreamIndex)).PixelAspectRatio = 1.21;
}
}
}
}
Jazzman54 wrote on 11/25/2011, 1:31 AM
@Jetdv, thanks for the script but I get an error when running on my 64bit W7 system. I have not had a chance to check this in detail, but I did a copy to the script area in V11 and changed the aspect ratio to my WD PAL version. From memory, the error message was something like 'missing error'!! I will investigate this further when I am back at base.
@Jerry, I have not yet tried your suggestions, but would really like to see the correct sized image in the preview window as I will be adding some FX.
The concept that it is a letterboxed video from the source will make me re-think what I need to do.
I will post progress and/or result.
Thanks all, Ian
amendegw wrote on 11/25/2011, 6:27 AM
"@Jerry, I have not yet tried your suggestions, but would really like to see the correct sized image in the preview window as I will be adding some FX."Can you put a few seconds of your source in a place where it's available for download? If you don't have a service readily available, I suggest the Dropbox - just copy the clip to your local "Public" folder, right-click, copy URL and post the link back here. Dropbox is really handy and free.

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

jetdv wrote on 11/25/2011, 6:31 AM
Make sure you do NOT copy the "Code Block" line - the first line begins with //

The last line is the last "}"

And make sure you save it as a .js - NOT a .cs.
amendegw wrote on 11/25/2011, 9:21 AM
Edward,

As an intellectual exercise, I'm writing a script to change the aspect ratio, with a user option to set the aspect ratio. It's just about done, but I have a question:

How would you write the following line of code in C#?

        VideoStream(new Media(currentEvent.ActiveTake.MediaPath).Streams.GetItemByMediaType(currentEvent.MediaType, currentEvent.ActiveTake.StreamIndex)).PixelAspectRatio = 1.21;


...Jerry (who's just a newbie to the world of script writing)

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9

Jazzman54 wrote on 11/25/2011, 10:45 AM
Back to base today, inspected the script, nothing wrong with lines, nothing wrong with file extension....ran perfectly!! Perhaps I needed a restart somewhere?!

One thing I have seen, with the script applied to the events, if I then delete all my events and drag a selection from the explorer tab, all the aspects are now correct as long as the removed events exist as project media. If they are removed from the project media bin, the aspect reverts back.
I learn something every day!
Thanks to all, and Edward for the script.
amendegw wrote on 11/26/2011, 3:18 PM
Okay, I figured out the way to set the aspect ratio in C#. Here's the generalized script to allow the user to specify the aspect ratio for all selected video events.

SpecifyAspectRatio.zip

Instructions are in the readme.txt file.

**Warning** I'm a real newbie to Vegas Scripting - use with caution!!

...Jerry

System Model:     Alienware M18 R1
System:           Windows 11 Pro
Processor:        13th Gen Intel(R) Core(TM) i9-13980HX, 2200 Mhz, 24 Core(s), 32 Logical Processor(s)

Installed Memory: 64.0 GB
Display Adapter:  NVIDIA GeForce RTX 4090 Laptop GPU (16GB), Nvidia Studio Driver 566.14 Nov 2024
Overclock Off

Display:          1920x1200 240 hertz
Storage (8TB Total):
    OS Drive:       NVMe KIOXIA 4096GB
        Data Drive:     NVMe Samsung SSD 990 PRO 4TB
        Data Drive:     Glyph Blackbox Pro 14TB

Vegas Pro 22 Build 239

Cameras:
Canon R5 Mark II
Canon R3
Sony A9