PDA

View Full Version : changing Aspect Ratio of AVC streams in .mp4


hhanh
17th December 2004, 08:11
Well ... I wrote a program to change the p/ar in the mp4 file. :)

--h

Selur
17th December 2004, 08:30
@hhanh: If it works, it would be nice if you could share it with the community :)

Cu Selur

hhanh
17th December 2004, 21:08
Sure. Here it is.

Selur
17th December 2004, 21:27
mods plz authorize :)

bond
17th December 2004, 22:07
splitted and authorized

hhanh, can you plz tell us the correct commandline options to use to change the ar, thanks :)

hhanh
18th December 2004, 00:42
Usage: ARChange.exe -i mp4-file -t track-no [-a width:height]

The track-no is the video track #. You can get it with mp4info. For mp4 files made with Nero Recode, I think it's always 3.

To display the current A/R:
ARChange -i test.mp4 -t 3

To change it to 8:9
ARChange -i test.mp4 -t 3 -a 8:9

A 4:3 DVD source has a PAR of 8:9 because it is 4/3 * 480/720
For a 16:9 DVD source, it's 32:27.

--h

Selur
18th December 2004, 10:35
thx for this tool :)

Cu Selur

SeeMoreDigital
21st December 2004, 18:02
Can somebody make a GUI for this tool?

Maybe hhanh and Moitah can get their heads together and add this functionality to MPEG4 Modifier :)

What do you say guys?


Cheers

Sharktooth
21st December 2004, 18:11
MPEG4Modifier lacks the MP4 container support.
Once (and if) it will be added MPEG4Modifier will be the definitive tool :)

SeeMoreDigital
21st December 2004, 18:15
Originally posted by hhanh
Usage: ARChange.exe -i mp4-file -t track-no [-a width:height]

The track-no is the video track #. You can get it with mp4info. For mp4 files made with Nero Recode, I think it's always 3.

To display the current A/R:
ARChange -i test.mp4 -t 3

To change it to 8:9
ARChange -i test.mp4 -t 3 -a 8:9

A 4:3 DVD source has a PAR of 8:9 because it is 4/3 * 480/720
For a 16:9 DVD source, it's 32:27.
And here are the settings you'll need for both PAL and NTSC 4:3 and 16:9 DAR (which are based on PAR): -

Required AR Custom DAR(PAR) Setting
4:3 PAL 64:60 (or 16:15)
16:9 PAL 64:45
4:3 NTSC 64:72 (or 8:9)
16:9 NTSC 64:54 (or 32:27)

Cheers

hhanh
21st December 2004, 20:15
I don't know, man. I'm working on a mp4 splitter/muxer at the moment. Besides GUIs were never my forte.

--h

bond
25th December 2004, 20:35
hhanh, i now found the time to test this tool with the following commandline:
ARChange -i "C:\path to\mymp4.mp4" -t 201 -a 16:11used 16:11 because thats the value defined in mpeg-4 for 16:9 pal

i also tested different .mp4 files (different ASP video streams, created/muxed with nero, mp4ui and mp4box) and different -t/-a settings, but i always got the following error message:
Assertion failed: !"Unexpected EOF", file ARChange.cpp, line 368

abnormal program terminationany idea what went wrong?

btw is it supposed to work with AVC or ASP video streams?

with avc .mp4 files (created with ateme/nero), i get the following error message:Assertion failed: fAR || !"A/R not present", file ARChange.cpp, line 567

abnormal program termination

Mosu
26th December 2004, 23:01
I guess it's for ASP only. I'm trying to implement AR extraction for AVC at the moment, and it totally sucks compared to ASP. WAY more complicated.

But if it CAN change the AR for AVC then I'd really like to see the source code for that :D

SeeMoreDigital
26th December 2004, 23:23
Originally posted by bond
any idea what went wrong? I've got a feeling this tool might currently only work with DAR values, such as the ones I posted.

Did you try any of them?


Cheers

bond
26th December 2004, 23:38
same results with the DAR values :(

SeeMoreDigital
27th December 2004, 13:04
Originally posted by bond
same results with the DAR values :( Oh well... I thought it may have followed what Moitah posted about DAR here: -

http://forum.doom9.org/showthread.php?s=&postid=561784#post561784

But if it don't... it don't!


Cheers

RanmaSaotome
28th December 2004, 23:56
Just like to say i tested your program on a Nero Digital AVC file & it worked fine. It was an avs file encoded using Recode2 in the max definition AVC profile.

C:\Encode>mp4box -info video.mp4
* Movie Info *
Timescale 1000 - Duration 00:25:41.164
Fragmented File no - 3 tracks
File Brand avc1 - version 0
File has root IOD
Scene PL 1 - Graphics PL 254 - OD PL 254 - Visual PL 255 - Audio PL 0

Track # 1 Info - TrackID 1 - TimeScale 1000 - Duration 00:00:01.000
Track is present in Root OD
Media Type "odsm" - Media Sub Type "MPEG" - 1 samples
MPEG-4 Config: ObjectDescriptor Stream - ObjectTypeIndication 1
Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 1000 - Duration 00:00:01.000
Track is present in Root OD
Media Type "sdsm" - Media Sub Type "MPEG" - 1 samples
MPEG-4 Config: SceneDescription Stream - ObjectTypeIndication 1
Synchronized on stream 1

Track # 3 Info - TrackID 3 - TimeScale 24000 - Duration 00:25:41.164
Media Type "vide" - Media Sub Type "avc1" - 36951 samples
Unknown track type


C:\Encode>ARChange -i video.mp4 -t 3
Current A/R = 1:1

C:\Encode>ARChange -i video.mp4 -t 3 -a 32:27
Current A/R = 1:1

C:\Encode>ARChange -i video1.mp4 -t 3
Current A/R = 32:27

Amazing how this tool just popped up right when I needed it thanks.

**Edit

Both nero show time & wmp now recogize the video as being 16:9 :)

It was encoded at a res of 600x400.

SeeMoreDigital
29th December 2004, 00:01
Blimey...

I wasn't expecting this tool to work with Mpeg4/AVC in MP4 files. Especially from a codec as advanced as Nero's!


Nice one!

bond
30th December 2004, 21:09
hm the following findings:

1) the tool only seems to work with .mp4 files where the avc stream already contains an ar value (which was not the case with the nero samples i had)

2) i created an avc stream with x264 and imported to .mp4 with mp4creator: seems as if x264 sets an ar in the stream when encoding automatically (in my case 64:45 for an encoded PAL 16:9 DVD source)

still i dont really get the tool to work 100% correctly:
- i run the tool on the file changing the ar
- a seperate x.mp4.out file get created (with the same filename as the input.mp4), which seems to be a valid .mp4 file
- nero and moonlight (only when you force overlay mixer2 in the graph) plays the file with the newly set ar :)
- still when i run the ar tool again on the renamed new x.mp4 it doesnt work "Invalid SAR value" :(

EthanoliX
30th December 2004, 21:58
Same problem here. The only difference is, the created file is not shown with the corrected ar. :confused:

Mosu
30th December 2004, 22:01
One problem this tool has is that it simply changes a couple of bytes in the avcC atom without decoding it properly. So it might work for some files, but it will break for others whose avcC is not layed out like the program expects.

bond
31st December 2004, 01:57
Originally posted by EthanoliX
Same problem here. The only difference is, the created file is not shown with the corrected ar. :confused:make sure to analyse the .mp4.out (remove the .out from the filename)!

Originally posted by Mosu
One problem this tool has is that it simply changes a couple of bytes in the avcC atom without decoding it properly. So it might work for some files, but it will break for others whose avcC is not layed out like the program expects.hm, maybe thats the reason why my output sample borks a little bit

Mosu
31st December 2004, 09:26
Ah mooo. Sorry, I obviously didn't look close enough at the source. It does parse the avcC atom. Sorry again.

RanmaSaotome
31st December 2004, 18:25
it may have a problem with PAL sources, my source was NTSC 16:9 & the file plays back correctly with or without overlay mixer added.

video1.mp4(NDparser)-->Nero Video Decoder-->Video Renderer.

as you say, its the file with .out at the end that has the changed AR.

kurt
5th January 2005, 22:01
everything went fine with my nero/avc testfiles (PAL source) and SeeMoreDigitals AR-Settings... thx for this nice tool hhanh! :p

pogo stick
8th January 2005, 22:11
Thanks Hhanh! Very nice! :)
It's working with avc for me, but not with every mp4.
Not with this one (http://pogo-stick.nm.ru/v.mp4). :(

hhanh
11th January 2005, 05:33
Sorry for the late answer. I was on vacation.

@bond: The unexpected EOF probably means that the file is not an AVC/MP4 file.
The assert on "A/R not present" mean that the AVCC atom does not have PAR information. Nero files always have it but there is probably a default value of 1:1. If you can't roundtrip a file through the tool, that's a bug :(

@SeeMoreDigital: P/AR of the form X:Y are supported for all X < 256 and Y < 256.

@pogo stick: I'll try your file when I get home. I'm still in transit - reenacting scenes from the Terminal.

--h

bond
11th January 2005, 21:42
great to have you back hhanh :)

could you reproduce my findings:
- doesnt work on files not having an ar info already
- not able to change the ar on files where the tool already changed the ar

also it might be nice if you could add an -o output option for defining an output file (to avoid that people have to change the extension)

thanks for your work :)

hhanh
12th January 2005, 00:10
Originally posted by bond
could you reproduce my findings:
- doesnt work on files not having an ar info already
- not able to change the ar on files where the tool already changed the ar

also it might be nice if you could add an -o output option for defining an output file (to avoid that people have to change the extension)

[/B]

The tool should work with files with an AR info present. Actually, it only works if there is an AR info. And you should be able to change the AR on the files again.
That said, there was a bug. Thanks pogostick for reporting it.

Here's an updated version. I added the -o option too.

SeeMoreDigital
12th January 2005, 00:18
Originally posted by hhanh
Here's an updated version. I added the -o option too. Can somebdy please make a GUI?


Cheers

pogo stick
12th January 2005, 21:21
Originally posted by hhanh
Here's an updated version.
Thanks a LOT! Now it's working! :)

pogo stick
11th April 2005, 11:00
Hhanh, did you think about making patch to mp4box? Would be great.
As far as I know, your tool is unique for AR changing in mp4.

hhanh00
11th April 2005, 19:44
Good idea. That shouldn't be difficult.

--h

Elias
11th April 2005, 22:57
One question hhanh00: does it change/add the aspect ratio values in the same way that MPEG4Modifier does it? That is, like the way XviD does it as well?

hhanh00
11th April 2005, 23:13
No, MPEG4Modifier works on the stream level. It modifies the A/R info stored in the VOL (or is it VOP?). That works for AVI. For the MP4 container, the A/R is somewhere in the MOOV atom (I don't remember where exactly). Incidentally, that's why I couldn't use MPEG4Modifier to change the A/R of my AVC/MP4 files.

--h

bond
12th April 2005, 18:18
mpeg4modifier doesnt handle avc but only asp (asp and avc are different things of course)

afaik the avc aspect ratio is also stored as part of the bitstream (even if in moov)
to my knowledge thats similar to how ar is stored with asp: in the vol, which to my knowledge is also part of the bitstream?

hhanh00
12th April 2005, 19:12
I don't know if the A/R is also stored in the AVC samples but VLC looks at the AVC1 atom for the aspect ratio. That's all I change with ARChanger.

--h

bond
16th April 2005, 15:25
AR is stored in VUI in the SPS afaik

hhanh00
17th April 2005, 10:10
Yes, that's the same thing. That guy is stored inside the AVCC atom.

DeeGee
24th April 2005, 06:36
I have some problems. I discovered the wonders of SmartBob(DGBob) and decided to encode some of the music videos I have on my DVD's into AVC/HE-AAC. Seemed to go fine. Then I noticed that now there is this handy tool. So redid them in anamorphic format. On another file it worked just fine, but on a another the ar chage seems to go fine, but the file is unplayable. FFDShow races trough the file without showing or playing anything and then crashing libavcodec.dll. Nero Showtime seems to actually make the video output screen resize into the correct aspect ration, but neither shows anything.

Here are some small samples.
no aspect ratio change (http://students.oamk.fi/~t3paja01/hero_noar.mp4)
aspect ratio changed (http://students.oamk.fi/~t3paja01/hero_ar.mp4)
These need quite a lot of punch from your machine as they are 704x400x50fps clips. (oddly libavcodec seems to crash also when you run out of cpu cycles on the file without ar change.)

hhanh00
24th April 2005, 07:05
Use apple dumpster and tell us the layout of your top level atoms. Is the moov atom before or after the mdat?

Thanks,
--h

DeeGee
25th April 2005, 09:03
The moov atom seems to be before mdat atom.

$00000000 ($00000014) 'ftyp' unknown atom
$00000014 ($0001f9b4) 'moov' Movie resource atom
$0001f9cc ($04b626dc) 'mdat' Movie data atom
$04b820a8 ($00000024) 'free' Free space atom


[edit] And the atoms on the file that the ar change works have just the same order. And if you didn't notice, I added sample files to my first post.

hhanh00
25th April 2005, 19:35
The problem is that the tool doesn't update the stco or co64 atoms. They indicate the offset of the media chunks in the file. When a new custom A/R is added and none was present in the file, it has to be inserted and the sample locations are changed if the moov atom was placed before the samples. I believe muxing with mp4creator60 puts the moov at the end. It's a crappy work around until the tool also updates the sample to chunk offset atoms.

Thanks,
--h

PS: You're using the 2nd version of this tool, right?

DeeGee
25th April 2005, 20:23
Yes, i'm using the second one you posted. So I need to use mp4creator instead of mp4box...

[edit] I just tested it out and it seems mp4creator (at least the version I have) changes the order to:
1. ftyp
2. moov
3. mdat

from the original
1. ftyp
2. mdat
3. moov

But archanger should work on files that have moov as last? It seems I have been trying to change ar after muxing the audio and video together. And both mp4box and mp4creator change the order so that moov isn't the last one. I simply need to do it before muxing? and it should work as long as mp4creator or mp4box doesn't lose the information on mux.

[edit2] Seems I'm lucky. Both Nero Recode 2 and x264 output mp4 files with moov as last atom. And at least mp4box conserved the information on mux. :)

ari
13th May 2005, 01:02
Originally posted by hhanh
Here's an updated version. I added the -o option too.

Err. Shouldn't that have the ARChange.cpp in it too?

hhanh00
13th May 2005, 03:17
Yes, I didn't attach the file previously. Rename to .cpp because the forum won't accept that extension.

--h

OCedHrt
27th May 2005, 10:11
What are AVC files? If I import/convert an xvid AVI into mp4 is it supposed to work? I get the EOF error when I try it.

SeeMoreDigital
27th May 2005, 10:34
Originally posted by OCedHrt
What are AVC files? Hopefully this will answer your question (http://forum.doom9.org/showthread.php?t=96059).


Cheers

Ajaja2005
25th June 2005, 16:14
How to change the aspect ratio in the h.264 HP stream in mp4 created with x264 (rev.270, wrong --sar)? Latest archange don't work :(

sbeyer20
15th July 2005, 13:25
Hi,

I donīt know what I have done wrong. I always get the EOF error. No matter if I muxed the material from AVi and from RAW but no chanche. So what is my failure?

Thanks Sven

charleski
23rd October 2005, 00:16
After much gnashing of teeth I've managed to get this working for large files produced from Nero Recode.

I had a file that I'd compressed at 3+Mbps and was over 2Gb, but after encoding it I noticed that the aspect ratio had come out wrong, probably because of a wrong decision upstream from the final encode. I wanted to retain the full vertical resolution that I had but needed an anamorphic sqeeeze that wasn't the standard 16:9 one. After much FAQ-reading and googling it looked like the best bet was to try to manipulate the flags in the .mp4 container rather than re-encode, as putting a resize in before re-encoding would have lost me some vertical scan-lines. Unfortunately none of the tools mentioned in the MP4 FAQ, including ARChange from here, worked on my large file, they all crashed out or gave assertion errors.

In a fit of madness I decided to try just hex-editing the file to change the flags by hand. Hmm, bad idea, I managed to waste many hours trying to figure that one out. Documentation on the MP4 atoms seems a bit skimpy. I've poured over mp4-layout.txt (http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt), but couldn't get anywhere with that (I couldn't find any explanation of how to decode the SPS and PPS fields) . So I went back to ARChange, which did at least crash with a readable assertion field. After a bit of fiddling and debugging I realised that the file offsets were stored as longs and must be overflowing. I changed every offset and length variable to a 64bit integer, and now it works, on my file at least, when using Nero Showtime to play the file (I tried the QT7 player, but it doesn't recognise the AR flags in avcC and it can't play Nero's CinemaAVC profile properly anyway).

I thought I'd upload the altered code back here, as this has certainly been a life-saver (many thanks hhanh00!), but there might be others with a similar problem. I might have altered some varaible that were fine as longs, but decided to do them all to be on the safe side. I suspect the problem with integer overflow is the reason that none of the GPAC tools etc managed to read anything from the file either.

[Edit: speeling]

SeeMoreDigital
24th October 2005, 16:35
You guys might be happy to know....

After a request from Kurtnoise13..... Jean Le Feuvre (aka: jeanlf), has included the ability to change the PAR of both MPEG-4 SP/ASP and AVC streams, to MP4Box ;)

More can be read about it here: -

https://sourceforge.net/tracker/?func=detail&atid=571741&aid=1311055&group_id=84101


Cheers

Elias
24th October 2005, 16:37
You guys might be happy to know....

After a request from Kurtnoise13..... Jean Le Feuvre (aka: jeanlf), has included the ability to change the PAR of both MPEG-4 SP/ASP and AVC streams, to MP4Box ;)

More can be read about it here: -

https://sourceforge.net/tracker/?func=detail&atid=571741&aid=1311055&group_id=84101


CheersNow that's pwnage stuff :D Thanks for the notification SMD!

SeeMoreDigital
24th October 2005, 17:06
Now that's pwnage stuff :D Thanks for the notification SMD!Hopefully Jean will be able to include VOBsubs support too!

When this happens, MP4box will be "the dogs nads" :D


Cheers

Elias
24th October 2005, 17:15
Hopefully Jean will be able to include VOBsubs support too!

When this happens, MP4box will be "the dogs nads" :D


CheersWhy do you want VOBsubs in mp4 when we got MPEG-4 Timed Text? :)

Sharktooth
24th October 2005, 17:35
coz only osmo can decode TTXT....

bond
24th October 2005, 17:39
coz only osmo can decode TTXT....wrong. videolan, quicktime and realplayer can do it too ;)

edit and of course haali + vsfilter can do it too!!!

Elias
24th October 2005, 17:47
coz only osmo can decode TTXT....I guess you haven't been in the subtitle forum for a while:

http://forum.doom9.org/showthread.php?t=101047

Enjoy! ;)

SeeMoreDigital
24th October 2005, 18:05
Why do you want VOBsubs in mp4 when we got MPEG-4 Timed Text? :)Recode2 generates streams with VOBsubs for use with NeroDigital certified stand-alone players. And software players - with the aid of Haali's splitter....

Currently, it's not possible to alter NeroDigital streams (ie: add/re-name the chapters, add/remove audio streams etc) using MP4Box if they include VOBsubs.

As you may already know I'm currently beta testing Zensonic's Z500 High Definition Network DVD Media Player, which (as well as other things) will eventually include NeroDigital certification.... Meaning multiple subtitle, audio and chapter support.

As the Z500 has a front vacuum fluorescent display (VFD).... it would be kinda cool to flick thru' the chapters and see the chapter names appear on-screen and/or on the VFD ;)


Cheers

Elias
24th October 2005, 18:10
Recode2 generates streams with VOBsubs for use with NeroDigital certified stand-alone players. And software players - with the aid of Haali's splitter....

Currently, it's not possible to alter NeroDigital streams (ie: add/re-name the chapters, add/remove audio streams etc) using MP4Box if they include VOBsubs.

As you may already know I'm currently beta testing Zensonic's Z500 High Definition Network DVD Media Player, which (as well as other things) will eventually include NeroDigital certification.... Meaning multiple subtitle, audio and chapter support.

As the Z500 has a front vacuum fluorescent display (VFD).... it would be kinda cool to flick thru' the chapters and see the chapter names appear on-screen and/or on the VFD ;) I understand. Personally though, I don't like it when any kind of software breaks specs compliance, and I do not want this feature to be implemented :D

Nero ought to implement Timed Text instead and ditch VOBsubs.

My 2 cents.

leowai
25th October 2005, 05:23
Nero ought to implement Timed Text instead and ditch VOBsubs.
This probably required a special function in the chipset for decode these chars in text. For eng subs should be no problem. What about other languages with thousand of different chars? i.e. Chinese (traditional & Simplified)?

In another words, this make the system much more complex at a very high cost (at this time).

I noticed some mp3 players are capable of displaying lyrics (I got one). However, not all text are "displayable". Some chinese chars can't be displayed!

This technology still needs improvements before it should be merged with MP4 hardware player. I doubt you could still enjoy a movie with crapped subtitles, could you?

Elias
25th October 2005, 09:10
This probably required a special function in the chipset for decode these chars in text. For eng subs should be no problem. What about other languages with thousand of different chars? i.e. Chinese (traditional & Simplified)?

In another words, this make the system much more complex at a very high cost (at this time).

I noticed some mp3 players are capable of displaying lyrics (I got one). However, not all text are "displayable". Some chinese chars can't be displayed!

This technology still needs improvements before it should be merged with MP4 hardware player. I doubt you could still enjoy a movie with crapped subtitles, could you?MPEG-4 Timed Text works as it should when decoded as UTF-8.

stephanV
25th October 2005, 09:50
I doubt there are any SAD's that support unicode.

Elias
25th October 2005, 10:12
I doubt there are any SAD's that support unicode.If they add full support for MPEG-4 Timed Text (which inevitably means Unicode support), I doubt it'll be any problem.

BTW, SAD = Stand Alone DVD?

stephanV
25th October 2005, 10:29
If they add full support for MPEG-4 Timed Text (which inevitably means Unicode support), I doubt it'll be any problem.
That means IF they do that, which is highly doubtful. Maybe some part of unicode will be supported. Most companies don't think twice about breaking standards if it fits their needs better.


BTW, SAD = Stand Alone DVD?
I was trying to type SAP (stand alone player). :o

Elias
25th October 2005, 10:32
That means IF they do that, which is highly doubtful. Maybe some part of unicode will be supported. Most companies don't think twice about breaking standards if it fits their needs better.Yes. DivX is a great example.I was trying to type SAP (stand alone player). :oBang up job, Stephan :D

Kurtnoise
25th October 2005, 12:09
You guys might be happy to know....

After a request from Kurtnoise13..... Jean Le Feuvre (aka: jeanlf), has included the ability to change the PAR of both MPEG-4 SP/ASP and AVC streams, to MP4Box ;)

More can be read about it here: -

https://sourceforge.net/tracker/?func=detail&atid=571741&aid=1311055&group_id=84101

Does anyone have already play with it in the last mp4box ?

I'll included it directly in YAMB asap...

SeeMoreDigital
25th October 2005, 12:49
Does anyone have already play with it in the last mp4box ?

I'll included it directly in YAMB asap...I'm not sure whether anybody (ie: Celtic Druid), has compiled it yet.... Do you know?


Cheers

Kurtnoise
25th October 2005, 13:26
No I don't know but I can provide my own compile (no icl9)...

bond
25th October 2005, 13:36
Does anyone have already play with it in the last mp4box ?hm i tried it already (cd made already a compile) but i dont seem to be able to find the correct syntax when changing the ar of an avc .mp4

on avc:
-add input.mp4#3:par=1:1didnt work: "bad parameters"

-add input.264:par=20:10on an input.264 that had already a par set, worked syntax-wise but the output had no par set in the raw stream

-add input.264:par=20:10on an input.264 that had NO par set, worked perfectly

on asp:
-add input.mp4#3:par=20:10on an input.mp4 that had NO par (1:1) set, worked perfectly

-add input.mp4#3:par=20:10on an input.avi that had already a par set, worked perfectly

-add input.avi:par=20:10on an input.avi that had NO par (1:1) set, worked perfectly

-add input.avi:par=20:10on an input.avi that had already a par set, worked perfectly

-add input.m4v:par=20:10on a raw input.m4v that had NO par (1:1) set, worked perfectly

-add input.m4v:par=20:10on a raw input.m4v that had already a par set, worked perfectly



it seems mp4box writes the par always as "custom par" and doesnt use the shortcuts for 16:9 pal (16:11) which i test for example

SeeMoreDigital
25th October 2005, 13:38
No I don't know but I can provide my own compile (no icl9)...I'm currently using your existing MP4Box compile with your last two YAMB beta's..... So yes please compile away :)

By-the-way. Where are you thinking of putting the "PAR changing" option. Will it be in here?

http://img497.imageshack.us/img497/5299/yambimportsettingsbox3kr.png


Cheers

SeeMoreDigital
25th October 2005, 14:02
hm i tried it already (cd made already a compile) but i dont seem to be able to find the correct syntax when changing the ar of an avc .mp4....

...it seems mp4box writes the par always as "custom par" and doesnt use the shortcuts for 16:9 pal (16:11) which i test for exampleDid you try any of the four main DAR values... ie: 16:15 for 4:3 PAL, 8:9 for 4:3 NTSC, 64:45 for 16:9 PAL or 32:27 for 16:9 NTSC?


Cheers

Kurtnoise
25th October 2005, 14:24
Ok...here is my fresh build (http://kurtnoise.free.fr/mp4tools/MP4Box_20051025.zip).

I only tested the DAR values proposed by SMD at beginning of this thread. And it seems to work fine when we check the tracks infos in mp4box.

Where are you thinking of putting the "PAR changing" option. Will it be in here?
Yes, probably under languages checkbox. There will be some presets (i.e 16:9 PAL, 4:3 PAL, 4:3 NTSC , 16:9 NTSC) + customs where you can write you own values.


on avc:
Code:

-add input.mp4#3:par=1:1

didnt work: "bad parameters"
Wrong syntax...;) Maybe ....
-add input.mp4#trackID=3:par=1:1


Question: which players support these DAR ?

SeeMoreDigital
25th October 2005, 14:53
Question: which players support these DAR ?I've sent DAR samples to many people with MP4 capable stand-alones/devices.... and they work just fine :)

With the exception of the Philips DVP64x range of players....... But I'm of the opinion the Philips (ESS) players are b0rked in a few other ways too.


Cheers

bond
26th October 2005, 11:57
talking about "DAR" is wrong here!!!

we are talking about the aspect ratio of the pixels, aka PAR for ASP or SAR for AVC!

SeeMoreDigital
26th October 2005, 13:15
talking about "DAR" is wrong here!!!

we are talking about the aspect ratio of the pixels, aka PAR for ASP or SAR for AVC!Some of us have been down this road many times before ;)

In the end, whether it be PAR, DAR, SAR... They can all be used to create encodes at the shape you require upon playback in software and hardware players.

As stegre posted some time ago....=========================================================================
Assuming

DAR = display aspect ratio - x/y ratio of physical dimensions (e.g inches or cm - NOT pixels) of display screen
PAR = pixel aspect ratio - x/y ratio of the physical dimensions of a single pixel
SAR = storage aspect ratio - x/y ratio of the #of pixels being encoded, always known from the file

=========================================================================
MPEG-4

DAR = PAR x SAR, where

PAR is based on "aspect_ratio_info" in the Video Object Layer

For aspect_ratio_info values 1 - 5,
PAR = 1:1, 12:11, 10:11, 16:11, and 40:33 respectively.

If aspect_ratio_info = 15, PAR is the custom value:
"par_width" / "par_height"

where par_width & par_height are any two relatively prime integers
between 1 and 255. Those two values are stored in the VOL as well.As you can see above, stegre refers to SAR as being "Storage Aspect Ratio". However, as we know SAR can also be used to refer to the Sample Aspect Ratio (ie: the aspect ratio of the finished encode or sample).

For those interested.... the rest of Stegre's post can be found here (http://forum.doom9.org/showthread.php?p=562532#post562532)....

Cheers

charleski
1st November 2005, 03:17
Has anyone managed to get this feature to work yet? I've been playing around with x264 encoding. Unfortunately it seems that x264 doesn't write a PAR to the video stream (or at least I haven't found an option for that in MeGUI, maybe there's a commandline switch I've overlooked?) so archange is unable to process it.

I've tried muxing with different PAR values using the mp4box compile Kurtnoise linked to, but none of the players I've tried (Nero Showtime, ffdshow, vlc) will recognise the resulting video, though they play the audio part.

bond
1st November 2005, 04:12
x264/megui allows the setting of a sar (aka par)

charleski
1st November 2005, 11:36
Aargh, I've just spotted the SAR field on the Advanced Config tab. Sorry.

EthanoliX
1st November 2005, 13:52
x264/megui allows the setting of a sar (aka par)

Thats right, but if you set the wrong A/R, archange is not able to correct it, at least in my case:

Assertion failed: fVUI || !"VUI not present", file ARChange.cpp, line 565

abnormal program termination

if I try changing the A/R in an mp4, created with x264, using an other A/R than 1:1.

bond
1st November 2005, 14:21
propably a bug in archange (maybe caused by the useage of high profile? just guessing), try mp4box too

peteag
12th May 2006, 21:12
mac version available? tried to makefile - nothing happend!