Set Aspect Ratio info inside the encoded video

Started by estragon1, August 26, 2012, 02:27:10 PM

Previous topic - Next topic

estragon1

#30
I was supposed to test and use the py files you kindly prepared for me, with only needing to switch MKV to MP4, wasn't I?

Or should I just do what you said in your previous message and add/edit the lines below, with appropriate changes (to what)?

adm.addVideoFilter("glResize", "width=768", "height=576")
adm.setContainer("MP4", "forceDisplayWidth=False", "displayWidth=1024")


Jan Gruuthuse

Yes:
adm.addVideoFilter("glResize", "width=768", "height=576") would fix [ ] 4:3 tv recordings
adm.addVideoFilter("glResize", "width=1024", "height=576") would fix [   ] 16:9 tv recordings
the fix is intended for players not taking in account the info provided inside the video clip

estragon1

And what about this:
adm.setContainer("MP4", "forceDisplayWidth=False", "displayWidth=1024")

as compared to the default:
adm.setContainer("MP4", "muxerType=0", "useAlternateMp3Tag=True")

Should I always set displayWidth to 1024?

Jan Gruuthuse

Sorry don't have a clue about those:  test it out with a small sample. I don't use mp4 or mp4v2 and would not know what the effect is for those.
If "forceDisplayWidth=False" then my guess would be it does not matter, only when "forceDisplayWidth=True" it would matter?

estragon1

Unless the .py file has a adm.loadVideo() line, it always crashes (in 2.6.0r8164) :(

Jan Gruuthuse

You need to place these as described here: Custom Menu and Saved projects then these work without the adm.loadVideo() line.

estragon1

#36
Quote from: Jan Gruuthuse on September 01, 2012, 12:03:41 PM
You need to place these as described here: Custom Menu and Saved projects then these work without the adm.loadVideo() line.
Right! Thank you.

And how do I find out which of swResize, opengl, VDPAUresize I should use? Do I try them all and decide, or does my graphics card support one or the other?

OK, it looks like opengl, VDPAUresize crash Avidemux, while swResize doesn't. So is only the latter compatible with my system, or is there something wrong?

I also remember trying the swResize Filter, when following zakk's suggestions. Well I tried again and saved the settings as a project to see the differences.

With swResize Filter the differences with your swResize filter are (in bold):

adm.addVideoFilter("swscale", "width=768", "height=576", "algo=2", "sourceAR=[b]2[/b]", "targetAR=[b]2[/b]")
(yours hane the value of 1)

Your MKV container setting also asks for
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1024")
as opposed to the MP4 defaults of
adm.setContainer("MP4", "muxerType=0", "useAlternateMp3Tag=True")

So, what could the sourceAR, targetAR (Aspect Ratios?) values of 1 or 2 mean?

Jan Gruuthuse

#37
In linux you can test their presence by passing one of these command in terminal:
VDPAU (only on some nvidia cards supported)
vdpauinfo
Quotedisplay: :0   screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library  304.43  Sun Aug 19 20:36:15 PDT 2012
...
OpenGL supported on several kinds of videocards (Intel, AMD, nvidia, ...)
glxinfo
Quotename of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
...
  • If VDPAU is present select preferred VDPAU resize filter
  • If no VDPAU support is present and OpenGL is present use OpenGL filter
With opengl could be display is not functioning correctly, if that is the case change settings in:
Edit -> Preferences -> [Video] -> Video Display: X11, Xvideo or VDPAU and don't use OpenGl for display.
If no VDPAU or OpenGL is present use the swResize.

Need to check for your videocard:
If supported by current OS and if you installed necessary packages/drivers
When resize filter is loaded open it in video filter and in configure, it will show the settings and what these do.
Don't think it is good to mix both methods, if you do, you need to test.