Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th December 2004, 08:11   #1  |  Link
hhanh
Registered User
 
Join Date: Nov 2001
Posts: 17
Well ... I wrote a program to change the p/ar in the mp4 file.

--h
hhanh is offline   Reply With Quote
Old 17th December 2004, 08:30   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,263
@hhanh: If it works, it would be nice if you could share it with the community

Cu Selur
Selur is offline   Reply With Quote
Old 17th December 2004, 21:08   #3  |  Link
hhanh
Registered User
 
Join Date: Nov 2001
Posts: 17
Sure. Here it is.
Attached Files
File Type: zip archange.zip (96.7 KB, 3298 views)
hhanh is offline   Reply With Quote
Old 17th December 2004, 21:27   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,263
mods plz authorize
Selur is offline   Reply With Quote
Old 17th December 2004, 22:07   #5  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
splitted and authorized

hhanh, can you plz tell us the correct commandline options to use to change the ar, thanks
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 18th December 2004, 00:42   #6  |  Link
hhanh
Registered User
 
Join Date: Nov 2001
Posts: 17
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
hhanh is offline   Reply With Quote
Old 18th December 2004, 10:35   #7  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,263
thx for this tool

Cu Selur
Selur is offline   Reply With Quote
Old 21st December 2004, 18:02   #8  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
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
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 21st December 2004 at 18:16.
SeeMoreDigital is offline   Reply With Quote
Old 21st December 2004, 18:11   #9  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
MPEG4Modifier lacks the MP4 container support.
Once (and if) it will be added MPEG4Modifier will be the definitive tool
Sharktooth is offline   Reply With Quote
Old 21st December 2004, 18:15   #10  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
Quote:
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): -
Code:
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
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 21st December 2004, 20:15   #11  |  Link
hhanh
Registered User
 
Join Date: Nov 2001
Posts: 17
I don't know, man. I'm working on a mp4 splitter/muxer at the moment. Besides GUIs were never my forte.

--h
hhanh is offline   Reply With Quote
Old 25th December 2004, 20:35   #12  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
hhanh, i now found the time to test this tool with the following commandline:
Code:
ARChange -i "C:\path to\mymp4.mp4" -t 201 -a 16:11
used 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:
Quote:
Assertion failed: !"Unexpected EOF", file ARChange.cpp, line 368

abnormal program termination
any 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:
Quote:
Assertion failed: fAR || !"A/R not present", file ARChange.cpp, line 567

abnormal program termination
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free

Last edited by bond; 25th December 2004 at 20:47.
bond is offline   Reply With Quote
Old 26th December 2004, 23:01   #13  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 3,529
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
__________________
Latest MKVToolNix is v15.0.0

If I ever ask you to upload something, please use my FTP server.
Mosu is offline   Reply With Quote
Old 26th December 2004, 23:23   #14  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
Quote:
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
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 26th December 2004, 23:38   #15  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
same results with the DAR values
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 27th December 2004, 13:04   #16  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
Quote:
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.ph...784#post561784

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


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 28th December 2004, 23:56   #17  |  Link
RanmaSaotome
Registered User
 
Join Date: Apr 2004
Posts: 14
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.

Last edited by RanmaSaotome; 29th December 2004 at 00:00.
RanmaSaotome is offline   Reply With Quote
Old 29th December 2004, 00:01   #18  |  Link
SeeMoreDigital
Life looks better in HD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 11,177
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!
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 30th December 2004, 21:09   #19  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
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"
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free

Last edited by bond; 30th December 2004 at 21:18.
bond is offline   Reply With Quote
Old 30th December 2004, 21:58   #20  |  Link
EthanoliX
Registered User
 
Join Date: Dec 2003
Location: Mainz/Germany
Posts: 21
Same problem here. The only difference is, the created file is not shown with the corrected ar.
EthanoliX is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.