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

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #15 on: August 28, 2012, 02:51:25 PM »
I know it works with Avidemux 2.5, because I used it a lot.
I tried the latest 2.5.6. It didn't work with it either  :(

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #16 on: August 28, 2012, 03:00:55 PM »
Sorry for the late reply.
in attachments 3 Tinypy Project resizes 576i StandardDefinition TV, so 16:9 is shown as 16:9 on flatscreens and so on.
- sofware only
- hardware opengl and vdpau (nvidia card)
load video and from Main menu -> File -> Tinypy Project - Run  Project
If your videocard supports
nvidia vdpau point to this one: SDto16x9VDPAU.py
opengl point to this one: SDto16x9openglResize.py
videocard support none of the above point to this one: SDto16x9VDPAU.py

original recording mpeg-ts 576i 16:9 found here orignal16by9.ts (7 MB)
saved to mkv without resizing: orignal16by9noresize.mkv (5 MB)
resized saved to mkv: orignal16by9resized.mkv (5 MB)

Should work with other encoders to. you only need to apply the video resize filter.
« Last Edit: March 19, 2017, 04:16:41 PM by Jan Gruuthuse »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #17 on: August 28, 2012, 03:07:30 PM »
If you use this filter on a regular basis you could do the same thing as done here: Custom Menu and Saved projects
dump the project in folder Screen.

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #18 on: August 29, 2012, 11:12:51 AM »
Thank you, Jan (thank you, zakk, again, too).

It looks like most of the broadcasts I record from my Dreambox channels are in 24:17 or 16:11. So will these scripts work, or could you modify them? (as I said I'm forced to use the 2.6 nightlies).


Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #19 on: August 29, 2012, 01:09:35 PM »
Projects are from 2.6. Download the original recording mpeg-ts 576i 16:9 sample and have look at it and see if it is similar.
These give me  big headache:
Pixel aspect ratio
Advanced Aspect Ratios - PAR, DAR and SAR
By any chance would these be freesat TV channels?
Or you could post a sample recording:how to Cut TS sample
and upload this to rapidshare (non pro should be free to use) or similar service and provide a link to it.
« Last Edit: August 29, 2012, 01:44:35 PM by Jan Gruuthuse »

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #20 on: August 29, 2012, 03:23:06 PM »
Thank you for your consideration. I've been through a lot of channels on the bucket bouquet I pay for, and watch or sometimes record, and so far I've got the following aspect ratio collection: 12:11, 16:11, 16:15, 24:17, 64:45.

Here you are your samples (deleted link). Tell me when you've got them, so I remove them.
 
« Last Edit: August 31, 2012, 09:35:04 PM by estragon1 »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #21 on: August 29, 2012, 04:57:49 PM »
Thanks for the 19 samples (250 MB), will have a look at these and let you know.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #22 on: August 29, 2012, 05:10:17 PM »
The clips you did upload are all 4:3 or 16:9.
Best you use a tool that gives you the correct information like MediaInfo
Il check the project later.
12:11 = 704*576 (4:3)
16:11 = 704*576 (16:9)
16:15 = 720*576 (4:3)
24:17 = 544*576 (4:3)
64:45 = 720*576 (16:9)







Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #23 on: August 29, 2012, 06:29:05 PM »
for each kind I did a test run, check if output is OK. Hard to judge, have no reference to what it should be? 68 MB download is now removed.
Output is targeted to PAL:
 PAL  4:3 768x576 and 16:9 1024x576
if NTSC would be required, change values in filter accordingly:
NTSC 4:3 640x480 and 16:9  854x480

not for HD TV! only SD TV 4x3 filter for 4:3 channels, 16x9 for 16:9 channels
« Last Edit: August 30, 2012, 06:02:45 AM by Jan Gruuthuse »

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #24 on: August 29, 2012, 11:47:24 PM »
Thank you, I'll check tomorrow. I've downloaded the rapidshare 65 MB file.

I had the original .ts files loaded in Avidemux 2.5.6, went to Pixel Aspect Ratio, under Output 1, MPEG-4 AVC Configuration, and set it "As Input"; it gave me the values I reported in parentheses, so the tool I used was Avidemux itself…

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #25 on: August 30, 2012, 05:51:14 AM »
Just have tested those on Samsung UE40B8000, it seems these play fine. Could need some more tweaking on the video section like an increase on the 2PASSBITRATE=2850 in x264?
Avidemux shows the PAR 1:1 if I'm not mistaken. It is all very confusing. Avidemux is not a player, is an editor. Some players don't use the internal file aspect ratios (flatscreen TV's when playing from USB sticks, networks, ....
When using the project files you can use preview, and these should show what you get while playing.
On the toolbar:
switch from Input View to Output view
Keep the project files as sample, you can adjust these when loaded and save as another Tinypy Project.
The header looks something like this:
Quote
#PY  <- Needed to identify #
#--automatically built--

adm = Avidemux()
adm.loadVideo("/home/jan/Videos/test.mkv")
adm.clearSegments()
adm.addSegment(0, 0, 12441000)
adm.markerA = 0
adm.markerB = 12441000
The bolded part should be left out: references to one video, and you don't want these in general purpose project.
« Last Edit: August 30, 2012, 06:05:20 AM by Jan Gruuthuse »

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #26 on: August 30, 2012, 08:42:30 PM »
But why do you use the MKV container, when it is suggested to use the MP4 container with AVC? Or, is it just the AVI container which should be avoided?
 
« Last Edit: August 30, 2012, 08:44:02 PM by estragon1 »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #27 on: August 31, 2012, 05:27:01 AM »
But why do you use the MKV container, when it is suggested to use the MP4 container with AVC? Or, is it just the AVI container which should be avoided?
Just have tested those on Samsung UE40B8000, it seems these play fine. Could need some more tweaking on the video section like an increase on the 2PASSBITRATE=2850 in x264?
...
Keep the project files as sample, you can adjust these when loaded and save as another Tinypy Project.
I needed to test on non computer player. You could use any container video codec / audio codec. As long as these work for your players. Avi can give problems with size/and audio tracks, ...
Use what works best for you, test with small sample file and keep tabs of your changes made in filter.

estragon1

  • Newbie
  • *
  • Posts: 20
Re: Set Aspect Ratio info inside the encoded video
« Reply #28 on: August 31, 2012, 10:39:32 AM »
Well, my basic need is a personal offline archive, and sharing online at Youtube. So, it's the problem of uploading to Youtube and getting a 1:1 or other odd ratios there, that bugs me most. And I do need compression, thus reencoding, together with best possible quality, when filesizes are big. A lot of time, it suffices to leave it as mpeg.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: Set Aspect Ratio info inside the encoded video
« Reply #29 on: August 31, 2012, 11:00:29 AM »
Load video, load provided filter
Change  in Video output to the codec you want, make the changes you want in configure.
Change in Audio Output to the codec you want, make the changes you want in configure.
Select in Output Format the container you want.

Save Project from Main Menu -> Tinypy project -> Save As Project -> Give it a name that makes sense for you.
Edit that file with name that makes sense.py and omit from that file the section referring to loaded file and markers:
Delete this block:
Quote
adm.loadVideo("/home/jan/Videos/test.mkv")
adm.clearSegments()
adm.addSegment(0, 0, 12441000)
adm.markerA = 0
adm.markerB = 12441000

you should now have a workable project for that aspect ratio and wanted container