News:

--

Main Menu

Unable to keep aspect ratio

Started by artdeco, October 17, 2012, 10:24:32 PM

Previous topic - Next topic

artdeco

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

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

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

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

Quote from: artdeco on October 18, 2012, 07:52:52 PM
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:
#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

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

#6
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

Jan Gruuthuse

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

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

Why would you use another program when it should work with avidemux when you edit and save the video clip?

Isias

QuoteThis 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

If the output is mkv you can force the display width in the container settings (configure)

Isias

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

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

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.