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

estragon1

  • Newbie
  • *
  • Posts: 20
Set Aspect Ratio info inside the encoded video
« on: August 26, 2012, 02:27:10 PM »
Newbie here, again. As I said in my previous message, I use avidemux (the x64 2.6 betas now, on Win7), in order to edit quickly my TV recordings from a Dreambox 7020.

Recordings are reported in Avidemux by File, Information as:
image size 544x576, aspect ratio unknown (24:17) or
image size 704x576, aspect ratio unknown (16:11)

Both look quite strange, almost square the first, on Avidemux, while they look fine (4:3, 16:9) on VLC.

If I use Video Output: Copy, Audio Output: Copy, Output Format: AVI Muxer, I get the clip I want, having edited out commercials, etc. Such a video plays in nice proportions (4:3, or 16:9) with VLC, and if I upload it on Youtube, it shows up fine.

But if I want to reencode my clips, to make them smaller in filesize, in x264/mp4, the output clip I get always looks ugly (exactly as the original inside Avidemux) in VLC, not in 4:3 or 16:9 as expected (and the same happens if I upload such a clip in Youtube). Now, if I go to VLC and change under Video, the Aspect Ratio, from Default to 4:3 or 16:9, the one I know that is right, the video will play fine.

It seems like reencoding doesn't "save" that Aspect Ratio information somewhere --or that I don't know how to force it to do so. I don't want to change the actual size of the video.

What am I missing there? I've read about SAR and PAR and DAR but it has not really helped. I would like to save my compressed AVI or MP4 files, and be sure that they will play in their expected sizes, no matter if it is on a software or hardware media player, or if I upload them on Youtube.

Excuse me if this topic has been covered here comprehensively before, yet I haven't found it.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 5573
Re: Set Aspect Ratio info inside the encoded video
« Reply #1 on: August 26, 2012, 02:44:48 PM »
If this about SD TV in 16:9 showing up as 4:3 try resize to 1024 x 576. Avidemux works with 1:1 pixels.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 5573
Re: Set Aspect Ratio info inside the encoded video
« Reply #2 on: August 26, 2012, 02:55:38 PM »
You can also play with Force display width.

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #3 on: August 26, 2012, 03:12:13 PM »
If this about SD TV in 16:9 showing up as 4:3 try resize to 1024 x 576. Avidemux works with 1:1 pixels.

Thank you but I don't understand your suggestion. I tried to describe the problem as clearly as possible, I'll rephrase it shortly below:

A. Source File information from Avidemux: image size 544x576, aspect ratio unknown (24:17)
1. Original ts file shows up like a square in avidemux (file info says 544x576). But it shows fine (4:3) in VLC, or Youtube
2. If I edit without reencoding (copy audio /copy video /avi muxer), avi fle still square in avidemux, but still fine (4:3) in VLC, or Youtube
2a. If I edit with reencoding (for example, mpeg4 AVC video, AAC audio /MP4 muxer), mp4 fle is "square" everwhere. I can correct the aspect ratio and set it manually to 4:3 in VLC to watch it properly, but on Youtube it stays "square".

Same for:
B. Source File information from Avidemux: image size 704x576, aspect ratio unknown (16:11)
1. Original ts file shows up inm odd proportions in avidemux (file info says 704x576). But it shows fine (16:9) in VLC, or Youtube
2. If I edit without reencoding (copy audio /copy video /avi muxer), avi fle still square in avidemux, but still fine (16:9) in VLC, or Youtube
2a. If I edit with reencoding (for example, mpeg4 AVC video, AAC audio /MP4 muxer), mp4 fle is "odd" everwhere. I can correct the aspect ratio and set it manually to 16:9 in VLC to watch it properly, but on Youtube it stays "odd".
« Last Edit: August 26, 2012, 03:43:20 PM by estragon1 »

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #4 on: August 26, 2012, 03:31:00 PM »
You can also play with Force display width.

Where is this? Only options for Configure, under MP4 Muxer Output Format is a Muxing Format (MP4/PSP options) dropbox and a Use Alternate MP3 Tags check box.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 5573
Re: Set Aspect Ratio info inside the encoded video
« Reply #5 on: August 26, 2012, 04:27:02 PM »
You can also play with Force display width.

Where is this? Only options for Configure, under MP4 Muxer Output Format is a Muxing Format (MP4/PSP options) dropbox and a Use Alternate MP3 Tags check box.
you can find this in 2.6 is better suited to handle mpeg-ts

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 5573
Re: Set Aspect Ratio info inside the encoded video
« Reply #6 on: August 26, 2012, 04:39:49 PM »
TV program 576i is either [ ] 4:3 or [   ] 16:9 (wide screen). If you re-encode 576i 16:9 and you resize in Video filter with these settings  1024 x 576 The video now will show 16:9 on vlc or or on flatscreen tv's. Can't explain it other way.

zakk

  • Hero Member
  • *****
  • Posts: 610
Re: Set Aspect Ratio info inside the encoded video
« Reply #7 on: August 26, 2012, 04:46:09 PM »
Did you try to change the "Pixel Aspect Ratio" when encoding ? (see video options)

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #8 on: August 26, 2012, 07:21:27 PM »
What I only found is under Video | Filters | Transform | swsResize.

There I suppose I have to unlock the Aspect Ratio and Resize dimensions from 704x576 to 1024x576, or from 544x576 to 768x576. This gives the 16:9 / 4:3 expected result. Which of the Resize Methods should I prefer?

Is this what I should do?



zakk

  • Hero Member
  • *****
  • Posts: 610
Re: Set Aspect Ratio info inside the encoded video
« Reply #9 on: August 26, 2012, 07:44:45 PM »
it's not in the filters but in AVC configuration

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #10 on: August 26, 2012, 07:53:12 PM »
it's not in the filters but in AVC configuration

I have Avidemux 2.6.0 (r8142) Windows 7 x64 installed. Could you tell me where I can find the "AVC configuration"?

Oh, you mean the "Configure" button under Video Output Mpeg4 AVC (x264). But I can't find "Pixel Aspect Ratio" in any of the tabs there…  :(
« Last Edit: August 26, 2012, 08:10:21 PM by estragon1 »

zakk

  • Hero Member
  • *****
  • Posts: 610
Re: Set Aspect Ratio info inside the encoded video
« Reply #11 on: August 26, 2012, 08:33:51 PM »
"Output 1" tab. Try "as input".

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #12 on: August 26, 2012, 10:33:14 PM »
Right, I had never gone past Advanced tabs, which were already far right!

I tried As Input to no avail. Then I tried Custom 16:9, 4:3, again no success, I tried the predefined ones PAL 4:3, NTSC 16:9, the same unsuccessful result. By that I mean that with default video aspect in VLC I see the 1:1 copy of the original. If I manually go to VLC, I can "correct" it to 4:3, 16:9 accordingly, but this information seems like it;s not store in the file. So if I upload it to youtube, it still comes out as a "1:1 copy" of the original, without the proper aspect ratio information. :(

zakk

  • Hero Member
  • *****
  • Posts: 610
Re: Set Aspect Ratio info inside the encoded video
« Reply #13 on: August 26, 2012, 11:10:49 PM »
I know it works with Avidemux 2.5, because I used it a lot.
Keep 2.6 for h.264 source only.

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #14 on: August 28, 2012, 01:08:07 PM »
Unfortunately, I have other reasons that I am using 2.6; they are discussed in the link of my initial post in this thread.