Author Topic: Unable to keep aspect ratio  (Read 19482 times)

artdeco

  • Newbie
  • *
  • Posts: 3
Unable to keep aspect ratio
« on: October 17, 2012, 10:24:32 PM »
Hi all newbie here need help with aspect ratio settings.
I have a mp4 video file I'm trying to crop and add second file to, but the output keeps reverting to aspect ratio of 1:1 and not the original of 16:9. I have tried all the settings under Mpeg4 AVC (x264) encoder configure  such as "As Input" and "Predefined Aspect Ratio" of 16:9 PAL. Also tried to use resize under filters to set aspect ratio to 16:9 and also resize image to 1024 x 576 but none of these work. The application does not seem to even remember settings, if I go straight back into settings then they have reverted to default.

Input file details from information show as:
Codec4CC:     H264
Image Size:    718 x 576
Aspect Ratio:  PAL 16:9 (64:45)
Frame Rate:   25,000 fps

Once cropped and re-encoded values are:
Codec4CC:     H264
Image Size:    718 x 576
Aspect Ratio:  1:1 (1:1)
Frame Rate:   24,582 fps

The original shows in widescreen format using Windows Media Player but recoded version shows square.

How do I get round this if at all and why does Avidemux not keep custom settings I choose.

System:
Windows 7 x64
Avidemux 2.6.0 (r8241) also tried basic 2.6.0 build

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: Unable to keep aspect ratio
« Reply #1 on: October 18, 2012, 05:22:02 AM »
In Output Format (Left bottom corner) Configure mark:
[v] Force display width and try with default Display width: 1024
There is a thread that goes deeper in to these issues: Set Aspect Ratio info inside the encoded video

artdeco

  • Newbie
  • *
  • Posts: 3
Re: Unable to keep aspect ratio
« Reply #2 on: October 18, 2012, 07:52:52 PM »
Jan thanks for the link but I had already read and re-read that thread and although it looked promising I still cant get Avidemux to do anything with the output apart from 1:1 Aspect Ratio. I already tried adding adm.addVideoFilter("glResize", "width=1024", "height=576") into a py files but application just crashes when I try and run it.
Also cannot understand why Avidemux will not remember and use setting you can set in GUI, why are they there if they can't be used?

styrol

  • Hero Member
  • *****
  • Posts: 533
Re: Unable to keep aspect ratio
« Reply #3 on: October 18, 2012, 09:13:24 PM »
Use Yamb or another MP4 box frontend or use mp4box command line:

MP4Box.exe -par 1=X:Y YourVideo.mp4

..where PAR=X:Y.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: Unable to keep aspect ratio
« Reply #4 on: October 19, 2012, 05:33:41 AM »
I already tried adding adm.addVideoFilter("glResize", "width=1024", "height=576") into a py files but application just crashes when I try and run it.
Also cannot understand why Avidemux will not remember and use setting you can set in GUI, why are they there if they can't be used?
1) I don't add the parameters, I use the avidemux GUI and change the settings in there and then save the the tiny py project and edit out the parts loading video and setting markers.
2) I have no knowledge on developers/programming/decisions. I, as user, try to have it working with what is provided.
When selecting opengl resize on a loaded video in video filter in GUI does it work then while playing the video in preview?
This is a specific example mpeg-ts to mkv:
Code: [Select]
#PY  <- Needed to identify #
#--automatically built-- glResize SD 16:9 mpeg-ts to mkv

adm = Avidemux()

adm.videoCodec("x264", "general.params=2PASSBITRATE=2850", "general.threads=99", "general.fast_first_pass=True", "level=31", "vui.sar_height=1", "vui.sar_width=1", "MaxRefFrames=2", "MinIdr=100", "MaxIdr=500", "MaxBFrame=2", "i_bframe_adaptive=0", "i_bframe_bias=0", "i_bframe_pyramid=0", "b_deblocking_filter=False", "i_deblocking_filter_alphac0=0", "i_deblocking_filter_beta=0", "cabac=True", "interlaced=False", "analyze.b_8x8=True", "analyze.b_i4x4=False", "analyze.b_i8x8=False"
, "analyze.b_p8x8=False", "analyze.b_p16x16=False", "analyze.b_b16x16=False", "analyze.weighted_pred=0", "analyze.weighted_bipred=False", "analyze.direct_mv_pred=0", "analyze.chroma_offset=0", "analyze.me_method=0", "analyze.subpel_refine=7", "analyze.chroma_me=False", "analyze.mixed_references=False", "analyze.trellis=1", "analyze.fast_pskip=True", "analyze.dct_decimate=False", "analyze.noise_reduction=0", "analyze.psy=True", "ratecontrol.rc_method=0", "ratecontrol.qp_constant=0", "ratecontrol.qp_min=0", "ratecontrol.qp_max=0"
, "ratecontrol.qp_step=0", "ratecontrol.bitrate=0", "ratecontrol.vbv_max_bitrate=0", "ratecontrol.vbv_buffer_size=0", "ratecontrol.vbv_buffer_init=0", "ratecontrol.ip_factor=0,000000", "ratecontrol.pb_factor=0,000000", "ratecontrol.aq_mode=0", "ratecontrol.aq_strength=0,000000", "ratecontrol.mb_tree=False", "ratecontrol.lookahead=0")
adm.addVideoFilter("glResize", "width=1024", "height=576")
adm.audioClearTracks()
adm.audioAddTrack(0)
adm.audioCodec(0, "LavAC3", "bitrate=192");
adm.audioSetDrc(0, 0)
adm.setContainer("MKV", "forceDisplayWidth=False", "displayWidth=1024")

artdeco

  • Newbie
  • *
  • Posts: 3
Re: Unable to keep aspect ratio
« Reply #5 on: October 21, 2012, 04:13:41 PM »
Thanks Jan but there is the problem I do make the changes in the GUI but they don't get remembered do they also don't get saved in the project file.
Looks like I will have to try another tool as suggested.

dave2972

  • Newbie
  • *
  • Posts: 1
Re: Unable to keep aspect ratio
« Reply #6 on: October 28, 2012, 05:43:53 AM »
I have the same problem using 2.6.0 when using the Mpeg4 AVC (x264) mode.  I have a video @ 720 x 576 PAL 16:9 aspect ratio and 2.6.0 ALWAYS encodes it at 1:1, even after I set it to 16:9.  This did not happen in 2.5.6.  Basically, it ignores the ratio setting for anything other than 1:1.  Also, the PSP and iPhone presets are broken.

And no, I do not want to resize the video as a work around.

I'm running the 64 bit version on Win7-64 with 16GB RAM and an AMD 8350 CPU
« Last Edit: October 28, 2012, 05:53:26 AM by dave2972 »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: Unable to keep aspect ratio
« Reply #7 on: October 29, 2012, 12:49:20 PM »
You're correct for the aspect ratio.
This is broken for 2.6 on Mpeg4 AVC (x264) in x264 Configuration on Tab [Output 1] watever you select on Pixel Aspect Ratio, you can't change it.
PSP and iPhone presets are not implemented or even present.

macduke

  • Jr. Member
  • **
  • Posts: 56
Re: Unable to keep aspect ratio
« Reply #8 on: December 06, 2012, 09:14:43 AM »
Hi.

For matroska I suggest to re-mux (not re-encoding needed) with mkvmerge tool included in MKVToolNix. You can change aspect ratio as you want and many more things (add audio, subtitles, chapters, etc.)

For avi I suggest MPEG4Modifier. Very simple program to change aspect ratio and very few other change.


Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: Unable to keep aspect ratio
« Reply #9 on: December 08, 2012, 05:55:37 AM »
Why would you use another program when it should work with avidemux when you edit and save the video clip?

Isias

  • Newbie
  • *
  • Posts: 25
Re: Unable to keep aspect ratio
« Reply #10 on: December 21, 2012, 04:40:17 PM »
Quote
This is broken for 2.6 on Mpeg4 AVC (x264) in x264 Configuration on Tab [Output 1] watever you select on Pixel Aspect Ratio, you can't change it.
With 2.6.0 it worked fine if you selected "As Input" in Pixel Aspect Ratio in the submenu "Output 1". Sadly, since 2.6.1 this option is now gray and no more selectable.

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10974
Re: Unable to keep aspect ratio
« Reply #11 on: December 21, 2012, 05:34:36 PM »
If the output is mkv you can force the display width in the container settings (configure)

Isias

  • Newbie
  • *
  • Posts: 25
Re: Unable to keep aspect ratio
« Reply #12 on: December 22, 2012, 03:58:43 PM »
Due to the devices i do own, i have to use mp4(v2) for compatibility reasons as the output container. The input material is a by MediaPortal TV Server recorded DVB-S2 HD stream in a .ts container. With 2.6.0, it is possible to select "As Input". Since 2.6.1, it's grey and can't be selected anymore.

frostik

  • Newbie
  • *
  • Posts: 1
Re: Unable to keep aspect ratio
« Reply #13 on: October 22, 2013, 09:00:39 AM »
Hi, I have the same problem as was discussed here.

I want to convert MPEG2 files to MKV (MPEG4 AVC c264 video, AAC sound). The aspect ratio that I set anywhere has no influence, it still converts to format like 4:3 or so. It even cuts a part of the video at bottom to fit it, but it seems that this is cut by avidemux decoder (Lavcodec). Should I create a new thread or write someone specific?

Thank you

AQUAR

  • Hero Member
  • *****
  • Posts: 1079
Re: Unable to keep aspect ratio
« Reply #14 on: October 22, 2013, 12:35:51 PM »
I think avidemux takes the pixel aspect ratio to be 1:1 and so any input with another pixel aspect ratio ends up producing an ouput with an "inverse" display aspect ratio.

Do the suggestions already mentioned here not work?
That is setting the display aspect metadata in the container - for avi's use mpeg4modifier and mkvmerge will do it for mkv's.