Page MenuHome

Failure to honor anamorphic display
Closed, ResolvedPublic

Description

System Information
Operating system: Ubuntu 16.04
Graphics card: Intel integrated

Blender Version
2.76 and 2.79

Short description of error
.mp4 videos that play correct anamorphic in all tried video players (e.g., VLC, Totem, etc) do not display correct anamorphic when previewed/rendered in Blender.

Exact steps for others to reproduce the error
Use HandBrake to create an .mp4 file: Put in a DVD, select a section, and use HandBrake to rip it with strict/automatic anamorphic setting. Play the created .mp4 file in various video players (e.g., VLC) and notice how anamorphic works perfectly. Now open Blender and Add the .mp4 movie. Notice how the movie previews/renders stretched out, not keeping the proper anamorphic.

Event Timeline

Unless it was changed lately, it is the same case with 2.80.

Are you referring to non-square pixels? If so, these are set here, in the Aspect X/Y section:

Don't think this is really a bug.

Greg (bvip7) added a comment.EditedMay 14 2019, 3:57 PM

Are you referring to non-square pixels? If so, these are set here, in the Aspect X/Y section:


Don't think this is really a bug.

Can you explain how these settings will stop the stretching? Raising those numbers only increases the stretch more. And those aspect numbers will not go below 1 which would seem to be needed to "reverse" the stretching.

I cannot use Blender to edit video because it will not give me proper looking image (the image is always stretched and not anamorphic). But if I watch the video I am trying to edit using a video player like VLC or Totem etc then the video plays with proper dimensions and is anamorphic.

I would like to use Blender to edit video. But I want the video to look "normal" when I watch it. That video will never look normal if edited/viewed in Blender.

Not sure if more of a bug or a feature request.
To be able to get correct size of each separate video strip.

These settings do not correct the view in Preview. They effect only the output (This is correct, this is what they need to do).
And do not help if you want to mix multiple videos.

There are workarounds, but not very intuitive (or correct).

Yes, that is true, they are not per clip, but per project/file. A way for the clip to be stretched based on the pixel aspect meta-data could be added, but that is in feature-request territory I think.

Greg (bvip7) added a comment.EditedMay 14 2019, 4:29 PM

I just don't understand why anyone would want distorted video.

If I have two .mp4 anamorphic videos that I load into Blender and "paste" together and then create one .mp4 video, the videos are going in anamorphic (playing non-distorted video) and coming out of Blender (rendered) distorted with stretched (unrealistic) looking people and surroundings. The video is completely ruined for viewing purposes. How could this be intended? If video goes in anamorphic, it should come out anamorphic, unless the user purposely distorts the video. In the current situation, the user can't even "distort" the distortion to make it so there is no distortion.

I don't think any of this is intended, but that Blender just does not support anamorphic video currently. While it would be nice to add, that would put it outside of the scope of the bug tracker and into feature requests.

I'll let @Richard Antalik (ISS) decide.

Greg (bvip7) added a comment.EditedMay 14 2019, 4:44 PM

It's just that anamorphic video is ubiquitous. If Blender doesn't support it, it seems to me that it would have near zero usefulness for editing videos. Every single video I would edit is anamorphic. I don't understand how anamorphic is not a requirement for a modern day video editor. And blender is the most talked about choice for video editing. So I'm surprised by this.

Blender should be able to preview anamorphic video and "keep" anamorphic. So if I input two anamorphic videos to combine them into one video, they should be able to come out anamorphic.

Blender is the most talked about choice for video editing? Really? Not in any editing suite or production company or film school I have ever seen. But ok.

Anyway, even in many commercial pro apps you have to manually stretch anamorphic video last time I checked.

Term anamorphic video is new to me, so I am not entirely sure how other players do deal with it. I would have to check, as it may be better to implement in FFMPEG preprocessing stage.

@Greg (bvip7)
Are you requesting only ability to preview that file correctly, or also to do anamorphic render?

Are you referring to non-square pixels? If so, these are set here, in the Aspect X/Y section:


Don't think this is really a bug.

@William Reynish (billreynish) those aspect ratio parameters did not affect render (at least from VSE) last time I checked that.
Or it did produce anamorphic video that other players rendered correctly? Hm not sure.

Greg (bvip7) added a comment.EditedMay 14 2019, 5:35 PM

Blender is the most talked about choice for video editing? Really? Not in any editing suite or production company or film school I have ever seen. But ok.
Anyway, even in many commercial pro apps you have to manually stretch anamorphic video last time I checked.

Yes, I didn't go into detail about what I meant. I was looking for something a home Linux user could use. And Blender kept coming up as a top choice.

Term anamorphic video is new to me, so I am not entirely sure how other players do deal with it. I would have to check, as it may be better to implement in FFMPEG preprocessing stage.
@Greg (bvip7)
Are you requesting only ability to preview that file correctly, or also to do anamorphic render?

Are you referring to non-square pixels? If so, these are set here, in the Aspect X/Y section:


Don't think this is really a bug.

@William Reynish (billreynish) those aspect ratio parameters did not affect render (at least from VSE) last time I checked that.
Or it did produce anamorphic video that other players rendered correctly? Hm not sure.

Ideally, I would like to be able to preview how the video is going to look once it is rendered. But the most important thing is that it renders anamorphic. Let me be clear, I'm not asking that Blender ADD anamorphic to an "imported" video that doesn't have it, just that it preserve an "imported" video's pre-existing anamorphic status.

I'm starting to be confused about what you mean when you refer to 'anamorphic video'.

Usually, anamorphic means that you have shot something with an anamorphic lens, which distorts and stretches the image so that you can get more vertical resolution onto the film negative. This image is then distorted in the opposite direction when projected:

'Anamorphic video' refers to video frames shot the same way, using an anamorphic lens, and will look like the first image on the left. You then need to distort the video frame to get the correct aspect ratio.

In Blender, this happens completely automatically. You just set the aspect ratio of the output correctly, and Blender will automatically stretch any footage to fit. So there's nothing missing and nothing for the user to do.

Greg (bvip7) added a comment.EditedMay 14 2019, 9:55 PM

I may not be describing things with the accurate terminology.

Let's name the two images you posted as Image-1 (squished) and Image-2 (normal looking).

If I have a .mp4 and play it in VLC it plays like Image-2 (normal looking). If I take that .mp4 and put it in Blender it previews as Image-1 (squished) and renders as Image-1 (squished). So I took an .mp4 that played normal looking but after putting it through Blender it now plays squished.

Does this help?

No, I actually still don't follow your problem. Because if you insert anamorphic (stretched) video into Blender, by default it will stretch back to normal, as long as you set the output resolution correctly.

If I take this image:

and insert it into Blender, I get this:

Which is correct.

I am setting the output res to what the numbers say. That is, VLC codec reports 720x480, Blender says 720x480, it was converted at strict 720x480.

Might someone try to replicate this. Take a chapter or section of DVD (720x480). Using HandBrake, create an .mp4 file. then put that .mp4 file into Blender and see if it displays properly. I have tried multiple DVDs and different settings. The image is always stretched (it looks like the stretched images). But it plays fine in VLC etc.

I still don't understand the problem. If your footage is stretched, Blender will un-stretch it if you either set the resolution correctly so it un-stretches the image. In Blender you must set the resolution manually. By default it is set to 16:9 (1920x1080) but you can set it to a different aspect ratio if you wish. There's nothing more to it.

Blender could have a feature to view non-square-pixel video in the viewer, but currently it does not have this feature. It also could be easier to transform video without needing to add effects strips for basic stuff. But those things are not needed to view anamorphic video, and are most definitely feature requests.

But why don't you just set the correct aspect ratio so that the footage becomes un-stretched?

Marking as archived until anyone can recreate an actual bug.

But why don't you just set the correct aspect ratio so that the footage becomes un-stretched?

Can you kindly tell me how to do this? I of course will do this if it solves the problem.

Here's the "actual bug" recreated with a different DVD than I originally tried.

The following screenshots show: HandBrake settings when creating the .mp4 video (720x480), both VLC and Totem playing said video unstretched and normal looking, and Blender stretching the video (no bars at top and bottom of image) in its preview window. When I render the video using Blender it comes out looking stretched too. Based on your images posted, I see no sign of it stretching your videos. So Blender has a bug that only affects some videos? Or is there something I can do to fix this?

Although I have no experience will try to explain a bit.
It is not an argument to reopen this report.

@William Reynish (billreynish) those aspect ratio parameters did not affect render (at least from VSE) last time I checked that.
Or it did produce anamorphic video that other players rendered correctly? Hm not sure.

Don't believe they affect render, must be only for metadata.

No, I actually still don't follow your problem. Because if you insert anamorphic (stretched) video into Blender, by default it will stretch back to normal, as long as you set the output resolution correctly.
If I take this image:


and insert it into Blender, I get this:

Which is correct.

By rendering this way will lose detail, by mixing pixels. Not ideal if only 1 video format with simple edits.
Can use while editing, but best is to set the original video format settings. But will look distorted in 'Preview'.
(Left image is from video player)


This video was created with these settings and will output the same Anamorphic format for video players.
.blend file with video.

@Greg (bvip7) Blender does not set automatically these numbers, will have to calculate yourself. Aspect X 1.185 in your example (853/720= 1.185).
Or can use the 'Display Geometry' resolution with some minor detail loss.

Richard Antalik (ISS) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.EditedMay 15 2019, 11:48 AM

@George Vogiatzis (Gvgeo) thanks for samples, I couldn't find anything to experiment with.

This video was created with these settings and will output the same Anamorphic format for video players.

Ok so there seems to be support for output

I would believe that I removed preview support by this patch D4315: Refactor drawing preview as first 7 lines would tell, but strangely this is report for older Blender versions.

So, an actual bug here is, that VSE doesn't apply aspect ratio correction set by user to the preview. I believe it should.
Should be easy to fix.

I guess "relying on the playback process to recognize and stretch it" is kind of expected, like as Blender (mostly) sets the the correct framerate on the first video that gets added.

So if I input two anamorphic videos to combine them into one video, they should be able to come out anamorphic.

They will, as long as you set the correct Aspect Ratio (or preset) Blender will honour the anamorphic.

As you can see the left is the render (U/V Image editor defaults to a 1:1 viewing Aspect Ratio)
And the right is the preview, which uses the render settings.

Notice how the movie previews/renders stretched out, not keeping the proper anamorphic.

This definitely sounds like the settings are incorrect...

Could you give us a metadata paste for your video files?

@Greg (bvip7) Blender does not set automatically these numbers, will have to calculate yourself. Aspect X 1.185 in your example (853/720= 1.185).
Or can use the 'Display Geometry' resolution with some minor detail loss.

Thank you so much for your comments! To make sure I understand, you advise doing the math for each video and setting Aspect X as you say? And when I render, this will correct the stretching problem? Setting Aspect X like you say does not fix the problem in the preview window.

I guess "relying on the playback process to recognize and stretch it" is kind of expected, like as Blender (mostly) sets the the correct framerate on the first video that gets added.

So if I input two anamorphic videos to combine them into one video, they should be able to come out anamorphic.

They will, as long as you set the correct Aspect Ratio (or preset) Blender will honour the anamorphic.


As you can see the left is the render (U/V Image editor defaults to a 1:1 viewing Aspect Ratio)
And the right is the preview, which uses the render settings.

Notice how the movie previews/renders stretched out, not keeping the proper anamorphic.

This definitely sounds like the settings are incorrect...
Could you give us a metadata paste for your video files?

How do I set the correct Aspect Ratio? You saw what parameters the video was created with (in my screen shots). And you see what resolution I have set in Blender when viewing the preview. Can you advise what settings I have wrong in Blender that is causing this stretching? I thought I had the correct aspect ratio settings set in Blender (720x480).

You are asking me to paste metadata? Can you advise how exactly I can gather this metadata so it can be posted here?

How do I set the correct Aspect Ratio?

For what I think you're trying to do, you shouldn't need to know how to work out aspect ratios.
If this is the screenshot you are talking about

I thought I had the correct aspect ratio settings set in Blender (720x480).

Resolution ≠ Aspect Ratio (Related viewing) It's probably best to use the presets. TV NTSC 16:9 in your case.

On line 34 there's a Display aspect ratio : 16:9 tag and that tells the player to override display's resolution aspect with a predefined aspect ratio.

1General
2Unique ID : 324998682704713740701650401530805323569 (0xF48078308B94317255AEBF45D9598731)
3Complete name : N:\M\Michael Jackson's This Is It\Michael Jackson's This Is It_t09.mkv
4Format : Matroska
5Format version : Version 2
6File size : 92.9 MiB
7Duration : 1 min 43 s
8Overall bit rate mode : Variable
9Overall bit rate : 7 496 kb/s
10Movie name : Michael Jackson's This Is It
11Encoded date : UTC 2019-05-15 10:33:28
12Writing application : MakeMKV v1.14.2 win(x64-release)
13Writing library : libmakemkv v1.14.2 (1.3.5/1.4.7) win(x64-release)
14
15Video
16ID : 1
17ID in the original source medium : 224 (0xE0)
18Format : MPEG Video
19Format version : Version 2
20Format profile : Main@Main
21Format settings : BVOP
22Format settings, BVOP : Yes
23Format settings, Matrix : Default
24Format settings, GOP : M=3, N=12
25Format settings, picture structure : Frame
26Codec ID : V_MPEG2
27Codec ID/Info : MPEG 1 or 2 Video
28Duration : 1 min 43 s
29Bit rate mode : Variable
30Bit rate : 7 041 kb/s
31Maximum bit rate : 8 000 kb/s
32Width : 720 pixels
33Height : 576 pixels
34Display aspect ratio : 16:9
35Frame rate mode : Constant
36Frame rate : 25.000 FPS
37Standard : PAL
38Color space : YUV
39Chroma subsampling : 4:2:0
40Bit depth : 8 bits
41Scan type : Interlaced
42Scan order : Top Field First
43Compression mode : Lossy
44Bits/(Pixel*Frame) : 0.679
45Time code of first frame : 01:05:43:20
46Time code source : Group of pictures header
47GOP, Open/Closed : Open
48GOP, Open/Closed of first frame : Closed
49Stream size : 87.2 MiB (94%)
50Language : English
51Default : No
52Forced : No
53Original source medium : DVD-Video
54
55Audio
56ID : 2
57ID in the original source medium : 189 (0xBD)128 (0x80)
58Format : AC-3
59Format/Info : Audio Coding 3
60Codec ID : A_AC3
61Duration : 1 min 43 s
62Bit rate mode : Constant
63Bit rate : 448 kb/s
64Channel(s) : 6 channels
65Channel positions : Front: L C R, Side: L R, LFE
66Sampling rate : 48.0 kHz
67Frame rate : 31.250 FPS (1536 SPF)
68Bit depth : 16 bits
69Compression mode : Lossy
70Stream size : 5.55 MiB (6%)
71Title : Surround 5.1
72Language : English
73Service kind : Complete Main
74Default : Yes
75Forced : No
76Original source medium : DVD-Video
77
78Text
79ID : 3
80ID in the original source medium : 189 (0xBD)32 (0x20)
81Format : VobSub
82Codec ID : S_VOBSUB
83Codec ID/Info : Picture based subtitle format used on DVDs
84Duration : 1 min 31 s
85Bit rate : 2 493 b/s
86Count of elements : 8
87Stream size : 27.8 KiB (0%)
88Language : German
89Default : Yes
90Forced : No
91Original source medium : DVD-Video

MakeMKV (what I used) tags the video file with the Display aspect ratio telling players how to display the stream.
Use something like Media Info to view the metadata.

Greg (bvip7) added a comment.EditedMay 15 2019, 11:48 PM

How do I set the correct Aspect Ratio?

For what I think you're trying to do, you shouldn't need to know how to work out aspect ratios.
If this is the screenshot you are talking about

I thought I had the correct aspect ratio settings set in Blender (720x480).

Resolution ≠ Aspect Ratio (Related viewing) It's probably best to use the presets. TV NTSC 16:9 in your case.

I understand now that the "preset" is what controls the aspect ratio possibilities. This was not clear to me before and I see now that changing the preset allows one to choose different aspect ratios.

Although the NTSC 16:9 preview does not show the "black bars" giving the impression that the aspect ratio is not correct, the aspect ratio is preserved after render. So I think that maybe you guys could consider making the preview pane display how it would look after render (i.e., show the black bars if they will be present) so people will know exactly what they are getting.

Thank you so much for your help! I really appreciate it.

Trouble is that DVD material both needs a PAR and a DAR correction to look correct on a computer:
https://en.m.wikipedia.org/wiki/Pixel_aspect_ratio
https://en.m.wikipedia.org/wiki/Display_aspect_ratio

Trouble is that DVD material both needs a PAR and a DAR correction to look correct on a computer:

This doesn't make sense. They are practically the same. If you have DAR, you know how to display the video. PAR is used to find DAR.
https://en.wikipedia.org/wiki/Pixel_aspect_ratio Here says exactly that the video's DAR = SAR × PAR.
SAR is from video's resolution. DAR is in the metadata.

Maybe confusing monitor's DAR.
This talks about monitor's DAR, not video's. https://en.wikipedia.org/wiki/Display_aspect_ratio
Nothing to do with blender.

From the article:

Poorly crafted user-interfaces or poorly written documentations can easily cause such confusion.

Did they had a specific software in mind? Aspect X and Aspect Y is confusing. It was a bit clearer in 2.79.

DAR is the final displayed aspect ratio, FAR is the frame aspect ratio, and PAR is the pixel aspect ratio.

DAR = FAR * PAR

Ex.

DAR = 720:576 * 16:15
DAR = 720 / 576 * 16 / 15
DAR = 1.33...

There is a function where selecting: "Strip > Set Render Size" automatically populates the correct resolution. It would sure be great to have "Set Render Size" also automatically select the "correct" preset too so that the aspect ratio is made accurate to the source.

I don't know if this is technically possible but it would be great for people who are just trying to match the source material. Then one could select "Strip > Set Render Size" and know for sure that their settings are recreating the source material accurately.