Author Topic: Set Aspect Ratio info inside the encoded video  (Read 65834 times)

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #30 on: August 31, 2012, 01:30:58 PM »
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)?

Code: [Select]
adm.addVideoFilter("glResize", "width=768", "height=576")
adm.setContainer("MP4", "forceDisplayWidth=False", "displayWidth=1024")
« Last Edit: August 31, 2012, 01:42:15 PM by estragon1 »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #31 on: August 31, 2012, 01:44:52 PM »
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

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #32 on: August 31, 2012, 02:55:51 PM »
And what about this:
Code: [Select]
adm.setContainer("MP4", "forceDisplayWidth=False", "displayWidth=1024")
as compared to the default:
Code: [Select]
adm.setContainer("MP4", "muxerType=0", "useAlternateMp3Tag=True")
Should I always set displayWidth to 1024?

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #33 on: August 31, 2012, 03:28:51 PM »
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

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #34 on: September 01, 2012, 10:46:02 AM »
Unless the .py file has a adm.loadVideo() line, it always crashes (in 2.6.0r8164) :(

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #35 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.

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #36 on: September 01, 2012, 01:21:06 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):

Code: [Select]
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
Code: [Select]
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1024")as opposed to the MP4 defaults of
Code: [Select]
adm.setContainer("MP4", "muxerType=0", "useAlternateMp3Tag=True")
So, what could the sourceAR, targetAR (Aspect Ratios?) values of 1 or 2 mean?
« Last Edit: September 01, 2012, 02:06:26 PM by estragon1 »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #37 on: September 01, 2012, 03:12:36 PM »
In linux you can test their presence by passing one of these command in terminal:
VDPAU (only on some nvidia cards supported)
Code: [Select]
vdpauinfo
Quote
display: :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, ...)
Code: [Select]
glxinfo
Quote
name 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.
« Last Edit: September 01, 2012, 05:27:46 PM by Jan Gruuthuse »