Set Aspect Ratio info inside the encoded video

Started by estragon1, August 26, 2012, 02:27:10 PM

Previous topic - Next topic

estragon1

Quote from: zakk on August 26, 2012, 11:10:49 PMI 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

#16
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.

Jan Gruuthuse

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

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

#19
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.

estragon1

#20
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.

Jan Gruuthuse

Thanks for the 19 samples (250 MB), will have a look at these and let you know.

Jan Gruuthuse

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

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

estragon1

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

#25
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.

estragon1

#26
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?


Jan Gruuthuse

Quote from: estragon1 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?
Quote from: Jan Gruuthuse 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?
...
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

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

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:
Quoteadm.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