Log in

View Full Version : MPEG4 Modifier v1.3.4 Released (Updated 2005-Dec-14)


Pages : [1] 2 3 4 5 6 7 8 9 10 11 12

Moitah
14th June 2004, 17:35
This program modifies a MPEG4 video (XviD, DivX) without re-encoding (aspect ratio, userdata, packed bitstream removal, and interlaced field order). The video must be in an AVI container. There is also a command line version (http://forum.doom9.org/showthread.php?t=117553) sharing most of the same features which even runs in other OSes with Mono.

IMPORTANT: As of version 1.4.0, requires the .NET Framework 2.0. Versions 1.3.4 and earlier require the .NET Framework 1.1 or newer.

NOTE: Aspect ratio modification works by changing a flag in the VOL headers, which is ignored by most decoders.


Changes:

1.4.4:Fixed a few small issues that prevented DivX subtitles from working.
Added *.divx to the supported extension list in the file dialogs.
A default file name is now provided when saving.1.4.3: Doesn't remove delay frames anymore, this caused synch problems with joined videos.
FourCC and user data information are now shown in the "Video Info" text.
It's now possible to pack videos containing drop frames.1.4.2: Fixed several problems with OpenDML reading/writing (writing bad OpenDML index entries, out of memory exception or unnecessary reading when loading, incomplete loading of files with damaged/missing index).1.4.1: Fixed some problems with packing which also required corrections to the timestamp calculation code.
If you try to load a non-MPEG4 video, the error message now displays which codec the file uses.
Better default directories for load/save file dialogs.1.4.0: AVI handling code completely rewritten, supports OpenDML and incomplete files (rebuilds the index including keyframe flags).
Ability to add/readd packed bitstream.
Optimized some parts, runs significantly faster.
Added Cancel button on load/save progress window.
Doesn't freeze explorer while loading a file after dropping onto the source textbox.
Updated code to take advantage of C# 2.0 features, and lots of cleanup.1.3.4: Re-added support for files with packed bitstream containing real N-VOPs (apparently the XviD 1.1 betas do this)1.3.3: Fixed bug when unpacking files with missing N-VOPs (caused by cutting/joining)
Removed support for files with packed bitstream containing real N-VOPs to simplify code1.3.2: New feature: Video Info now shows how many warp points are actually used (for example, DivX indicates 2 warp points in the VOL, but the 2nd one is never used)
Added detection for corrupt RIFF chunk sizes
Fixed byte order problem in AVI index on big endian systems (for command line unpacker running on OS X)1.3.1: Added percent in titlebar of progress window
Added 1.85:1 display aspect ratio
Fixed saving AVIs with no index
Fixed small cosmetic issues in main window1.3.0:
New feature: option to automatically change user data when unpacking
Fixed bugs with 'rec ' list indexing
Added progress bar during load and save
A file can be loaded from the command line, or by dropping it on the AVI Source text box
Error checking is less strict (no more "No dummy N-VOP found for packed frame" and "Invalid VOL" errors)
Files are closed sooner, and output file is deleted if an error occurs during save
Other code improvements and clean-up1.2.0:
New feature: modification of field order for interlaced videos
New feature: video information (i.e. whether or not QPel/GMC were used, stats for how many I/B/P/S/N-VOPs were used, list of VOP type and timestamp for each frame, etc.)
Packed bitstream removal can now tell the difference between dummy N-VOPs and real N-VOPs (though I'm told no encoder currently writes real N-VOPs in a packed bitstream)1.1.0:
New feature: packed bitstream removal
New feature: userdata modification
Recognizes frames written in '00db' chunks1.0.0 (Changes over the "rp.exe" preview (http://forum.doom9.org/showthread.php?s=&threadid=76828)): Has a proper GUI
Warns if the AVI is OpenDML
Reads the frame width/height from the video (for DAR->PAR calculation)
Writes dwSuggestedBufferSize in the video stream header (it wrote 0 before)
Supports 'rec ' lists
Code has been restructured

http://www.moitah.net/MPEG4Modifier.png


Download: Binary (http://www.moitah.net/download/latest/MPEG4Modifier.zip) | Source (http://www.moitah.net/download/latest/MPEG4Modifier-Source.zip)

bond
14th June 2004, 18:48
seems to work great (also with other mpeg-4 codecs (not only divx5 and xvid), like 3ivx :) )

especially i like the display of already existing ar info stored in the stream :)

communist
14th June 2004, 19:04
Works fine for me. Tested with XviD encodes and VLC media player.
Thanks for the nice tool :)

SiXXGuNNZ
14th June 2004, 21:11
thanks for the app and now the gui :)

Moitah
14th June 2004, 21:20
I'm glad it's working okay :D. Could someone take a screenshot of it with a video loaded in Windows XP/2003 with the new visual style? I think it should display properly using the new style controls but I have no way to test it.

bond
14th June 2004, 21:57
it seems to need pretty long to load tough (i am under winme)

SiXXGuNNZ
14th June 2004, 23:48
Originally posted by Moitah
I'm glad it's working okay :D. Could someone take a screenshot of it with a video loaded in Windows XP/2003 with the new visual style? I think it should display properly using the new style controls but I have no way to test it.

?

http://www.10kbullets.com/xp-theme.jpg

this what you asking?

mikeX
15th June 2004, 00:14
visuals work fine here as well:
http://users.ntua.gr/el01707/downloads/mpeg4mod-1.png

It takes some time to load here as well for a 48KB executable (P4 1.8, nothing crazy though), but I guess that can't be helped with .NET.

Moitah
15th June 2004, 04:00
Yeah that's what I wanted to see, thanks guys, it looks fine.

mikeX: I looked at the AVI you sent. It will be simple to fix but I won't have time to mess with it until tomorrow evening.

sysKin
15th June 2004, 04:17
Hi,

now that you have a VOL header parser/rewriter, I have a feature request :)

Please pretty please let us re-write (or add, if there wasn't any) userdata info :D

Userdata has a startcode 0x000001b2 and is followed by normal ascii string. Comes after VOL, but might even come before it, I'm not sure.

It would be very very useful for the following two things:
- removing fake DivX userdata ("DivX999b000p") which makes xvid expect packed bitstream, and completely b0rks decoding from mp4. This *is* an xvid ussue but until it's fixed, it would be a great workaround.

- adding "old xvid" identification, which will make new xvid decode old (xvid .9) streams correctly. These streams do not have any userdata, and xvid assumes iso mpeg-4, but they are broken. If xvid can identify them with proper userdata, it would apply a workaround and decode them good.
The userdata for that is "XviD0001".

Regards,
Radek

Moitah
15th June 2004, 04:39
Originally posted by sysKin
Please pretty please let us re-write (or add, if there wasn't any) userdata info :D
I was thinking about doing this already, actually. That's why I gave the program a more generic name instead of "Aspect Ratio Modifier" :).

SeeMoreDigital
15th June 2004, 10:11
Originally posted by Moitah
I was thinking about doing this already, actually. That's why I gave the program a more generic name instead of "Aspect Ratio Modifier" :). I had wondered about why you named it what you did!

This is a fabulous tool I've already used it to change the AR of a couple of 800MB DivX encodes, prior to muxing into an MP4 container.

No speed problems here, as your tool could change the AR header and re-write a new file much faster than mp4UI can mux :D

Additional features, such as packed bitstream removal, 4CC changing, and being able to add/alter 'summary information' would be the icing on the cake.

That said, it's a really great tool already.

There are a lot of clever people on this forum... I just wish I was one of them!


Cheers

bond
15th June 2004, 20:56
hm i am not so sure if its a that good idea to make it too easy to change the user data of the bitstream
i mean it should represent the infos the encoder thinks should be set!
i dont think it should be compared to the fourcc, which the people change as they wish... the user data should really be a very accurate way to show the correct info about the bitstream!

for example i find it very usefull if i analyse a buggy mp4 file and see that the stream was originally packed by the encoder, which points to possible solutions
now if people start to mess around with this (who knows what people are going to do...) its not that good imo

maybe the editing should really be limited to very specific tasks, like the ones syskin mentioned and should not include a "you can change it all as you want" option

also about the "packed bitstream flag removing" option (as simply too many muxers exist which dont unpack the stream when muxing to mp4, its really important to know that the stream was packed originally!!) i think it would be a really better solution if the xvid decoder could ignore the bitstream description, than allowing the people to change the flag in avi, which means its in no way ensured that a correct mp4 muxer is used afterwards!
also maybe giving the user the false security that if this is changed, packed bitstream might cause less problems in mp4 or so, which is not the case of course

its good to have an easy way to identify originally packed bitstreams in mp4, as its really an important issue!
therefore i dont think people should be able to manually remove flags set by the encoder indicating that the stream was packed originally!

bond
17th June 2004, 08:58
i just thought about a possibility to make it work with the xvid decoder, but still have it marked that the stream has been initially packed:

only change the "p" at the end of the user data of divx5 and xvid to "n"!
that way the xvid decoder will not bork anymore, but its still clear if you analyse the user data, that the stream was output packed by the encoder :)

GrEEk_OuTcAsT
17th June 2004, 18:21
Hm, I think this that I ask is difficult. How about supporting matroska files? I know that in the video streams in matroska you can select AR, but it doesn't work to me ;).

Zhnujm
18th June 2004, 21:03
Just got the right firmware to try it with my Xoro311pro, works fine.

Thanks. :)

unmei
18th June 2004, 21:28
GrEEK_OuTcAsT: are you sure they are not written to the file? or is it just your player doesn't know what to do with it? Because if its a player issue no additional tool can fix it..

I set my aspect ratio always on muxing with mkvmerge and it always worked so far. The shell extesions shows it and both MPC and TCMP use it correctly (and these are the only players i use).

bond
19th June 2004, 10:39
Originally posted by GrEEk_OuTcAsT
Hm, I think this that I ask is difficult. How about supporting matroska files? I know that in the video streams in matroska you can select AR, but it doesn't work to me ;). they way AR is stored in matroska has nothing to do with the AR stored in mpeg-4 streams themselves, therefore mpeg4modifier isnt really the right tool for changing matroska aspect ratios

SeeMoreDigital
19th June 2004, 12:12
Moitah,

Have you had chance yet to decided what other features you are going to include?


Cheers

Soulhunter
19th June 2004, 17:47
Originally posted by bond
Also about the "packed bitstream flag removing" option...And, re-writing the AVI unpacked ???


Bye

SeeMoreDigital
19th June 2004, 17:50
Originally posted by Soulhunter
And, re-writing the AVI unpacked ??? This would be a dream come true :D

bond
19th June 2004, 17:52
Originally posted by Soulhunter
And, re-writing the AVI unpacked ???well if possible :D
but i think syskin meant more only the bitstream description changing not the whole video stream

Soulhunter
19th June 2004, 18:45
Ahh, thought it was a reply to S.M.D's post !!!
Originally posted by SeeMoreDigital

Additional features, such as packed bitstream removal, 4CC changing, and being able to add/alter 'summary information' would be the icing on the cake.
Bye

kassandro
20th June 2004, 18:25
Which players use these avi aspect ratios? Are there any hardware players too?

SeeMoreDigital
20th June 2004, 18:43
There is a MediaTek chipset based stand-player which can detect AR signalling incorporated into the bitstream.

Have a look in the "hardware section"!


Cheers

Moitah
24th June 2004, 23:28
Version 1.1.0 released, first post has been updated :).

Moitah
24th June 2004, 23:35
Originally posted by bond
hm i am not so sure if its a that good idea to make it too easy to change the user data of the bitstream I thought about your suggestion but couldn't think of a nice way to do it, and I would hate to limit its abilities. :(

sysKin
25th June 2004, 05:03
Originally posted by Moitah
I've just discovered that packed bitstream removal for DivX5 may be broken. An update: it isn't. It's xvid decoder that is broken, and the bug is really really stupid.

This happens on divx5 streams but not xvid PB streams. I'll commit the fix, but you'll probably need xvid 1.1alpha to have it working.

Radek

SeeMoreDigital
25th June 2004, 10:56
I've just removed the packed bitstream from an DivX 1B-VOP packed bitstream encode.

When you play it back via WMP9 or MPC the image shakes about like something from an Irwin Allen disaster movie. Forcing the encode to play via XviD's DSdec filter reveals the same symptoms. Everything is OK if you delete all the UserData though.

Perfect playback via the 3ivX DSdec filter or via Nero's ShowTime player, with or without the UserData!

Tried the same test with an XviD 1B-VOP packed bitstream encode. And the same thing happened...

Sadly this tool has not helped me with XviD 1B-VOP encodes played back via Sigma Xcard.... so god knows what makes XviD and DivX so different in this regard!


This tool is great fun... I love it...

pogo stick
25th June 2004, 21:46
Originally posted by Moitah
New feature: packed bitstream removal
Great! Thanks, Moitah!
So should I remove 'DivX999b000p' part in XviD movie or just change 'p' to 'n' when removing packed bitstream? And, just out of curiosity, what all the numbers and letters after DivX and XviD mean? I was told that 'p' is packed bitstream and 'c' is cartoon mode.

bond
25th June 2004, 21:55
Originally posted by pogo stick
Great! Thanks, Moitah!
So should I remove 'DivX999b000p' part in XviD movie or just change 'p' to 'n' when removing packed bitstream? And, just out of curiosity, what all the numbers and letters after DivX and XviD mean? I was told that 'p' is packed bitstream and 'c' is cartoon mode. change the "p" to "n"
that way no decoder will think that its still packed, but still it will be possible to detect that the stream had been outputted packed by the encoder if something is borky

Moitah
25th June 2004, 22:07
Originally posted by pogo stick
So should I remove 'DivX999b000p' part in XviD movie or just change 'p' to 'n' when removing packed bitstream? And, just out of curiosity, what all the numbers and letters after DivX and XviD mean? I was told that 'p' is packed bitstream and 'c' is cartoon mode. If it's an XviD encode, you can just remove the fake DivX userdata when unpacking the bitstream. The XviD encoder only writes DivX userdata when packed bitstream is used. For a DivX encode, I believe you can either remove the 'p', or change it to 'n'.

The XviD userdata string is 'XviD' followed by a 4 character bitstream version (for example, XviD 1.0.1 writes the userdata 'XviD0035'). If the character 'C' is appended to the end, this indicates cartoon mode. The DivX userdata string is 'DivX' + version + 'b' + build ('DivX503b1031' for DivX 5.1.1), followed by a 'p' if packed bitstream was used.

EDIT: bond was quicker :). Yeah, if you want to leave the fake DivX userdata string in there and just change 'p' to 'n' it won't hurt anything.

SeeMoreDigital
26th June 2004, 09:48
I noticed when you generate a DivX5.1.1 encode with 1B-VOP packed bitstream (PBS). MPEG4 Modifier displays the UserData as being, DivX503b1031p.

And when you generate a XviD1.0.1 encode with 1B-VOP packed bitstream (PBS). MPEG4 Modifier displays the UserData as being, DivX999b000p and XviD0035

The DivX user code is totally different. Could it be something as simple as this that confuses some stand alone players?

And... I remember some people on the DivX forum wanting a tool that could detect the exact version of DivX that was used in an encode. Could this tool do this?


Cheers

bond
26th June 2004, 10:01
Originally posted by SeeMoreDigital
The DivX user code is totally different. Could it be something as simple as this that confuses some stand alone players?i dont think so, as thats simply the way how divx5 and xvid mark packed bitstream AND a decoder should NOT look at the user data and in fact no decoder does it atm, except the one from xvid :(

And... I remember some people on the DivX forum wanting a tool that could detect the exact version of DivX that was used in an encode. Could this tool do this?should be possible
someone would have to investigate which version number used which "bitstream version" and create a list

i dont really like the idea that people can mess around with the user data, its simply a very accurate way to identify the used codec (including some codec settings) and there shouldnt be a reason why to change it (except with the xvid decoder, which syskin already announced to change to not care about the user data anymore :) )

SeeMoreDigital
26th June 2004, 11:04
Originally posted by bond
should be possible
someone would have to investigate which version number used which "bitstream version" and create a list I guess somebody at DivX could provide this and maybe throw in some beta codings!

I can see this tool being useful for some DivX users...

I've always found Sigma's AVIcheck (http://82.2.167.24/Uploaded_Files/Doom9_Forum_files/AVIcheck.zip) to be useful (I know - don't say it). Although it can't tell you the version of DivX used, it can very quickly, tell you if the stream contains B-VOP's, S-VOP and Qpel. To have something like this in MPEG4Modifier would be great, especially if it could tell you how many consecutive / variable B-VOP's were used!

Would this be possible?


Cheers

gotaserena
26th June 2004, 14:18
Originally posted by SeeMoreDigital
it can very quickly, tell you if the stream contains B-VOP's, S-VOP and Qpel. To have something like this in MPEG4Modifier would be great,

Yup something like a/v streams info would be nice...

BTW I'm finding the error "Startcode not found at the beginning of the frame" when I try some .avis. Is the problem in the stream or the program?

especially if it could tell you how many consecutive / variable B-VOP's were used!

But doesn't this require an extensive analysis of the stream? The program would turn into another DRFAnalyzer... FWIW I would like to have compatibility with .mp4 (or .mkv), but I guess that's too much work.

Great tool, Moitah!

Moitah
26th June 2004, 14:37
Originally posted by gotaserena
I'm finding the error "Startcode not found at the beginning of the frame" when I try some .avis...This happens when you load a video that isn't MPEG4 compliant.

Originally posted by gotaserena
Great tool, Moitah!Thanks :)

Moitah
26th June 2004, 14:48
Originally posted by SeeMoreDigital
... it can very quickly, tell you if the stream contains B-VOP's, S-VOP and Qpel. To have something like this in MPEG4Modifier would be great, especially if it could tell you how many consecutive / variable B-VOP's were used!

Would this be possible?
It would be possible, sure. I already have to determine each frame's VOP type (I/P/B/S/N) for removing packed bitstream. I don't know if generating stats is something I want to add, but I will think about it.

SeeMoreDigital
7th July 2004, 10:18
Moitah,

I've had yet another wild thought!

Would it be possible to create a tool that can alter the PAR and DAR of Mpeg1 and Mpeg2 streams?

And....

If you is possible to adapt MPEG4Modifier to show if an Mpeg4 stream contains B-VOP, Qpel and GMC. Would it also be possible to identify the type of GMC was used ie: 1WP or 3WP?

This sort of feature should prove useful for some of us hardware player users!

And....

Given that MPEG4Modifier is not specifically related to XviD, would it be better to move this thread to another part of the forum. I reckon loads of people are missing out.


Cheers

Moitah
9th July 2004, 04:40
@SeeMoreDigital: I'm not really interested in messing with MPEG 1/2. I would like to do some stats in the next version, including B-VOP/QPel/GMC information (yes, I believe I will be able to determine the number of warp points). Also I plan to allow the field order flag to be modified for interlaced encodes.

eb
9th July 2004, 07:50
Thank you Moitah for nice tool, working good with 3ivx .avi and VLCplayer is reacting nicely for the changes done by Mpeg4Modifier.

Very interesting experiments can be carried out with anamorphic 2.35:1 pictures that are encoded with 3ivx with pixel matrix 720x576 and latter modified to 2.35:1 by Mpeg4Modifier.

eb

SeeMoreDigital
9th July 2004, 12:55
Originally posted by eb
Very interesting experiments can be carried out with anamorphic 2.35:1 pictures that are encoded with 3ivx with pixel matrix 720x576 and latter modified to 2.35:1 by Mpeg4Modifier. Have you been cropping 2.35:1 images and encoding them using 720x480/576 pixels. And then MPEG4Modifier to correct the DAR back to 2.35:1?

If so it's quite nifty feature. And such is the power of DAR over PAR. But you can do it with XviD and DivX too!


Cheers

eb
9th July 2004, 14:16
SeeMoreDigital wrote:Have you been cropping 2.35:1 images and encoding them using 720x480/576 pixels. And then MPEG4Modifier to correct the DAR back to 2.35:1?
Yes, exactly croping then resizing to 720x576 and Mpeg4Modifier back to 2.35:1. All this tests are done on sattv records.
I see that you have SS2 card /my advice to you HotBird 13, 10911V, MCE radio, you can record simultaniously 10 (ten) MCE channels and every song or piece of music is recorded separately - it is only pity that MCE webpages with song titles and albums are not more working/.
Gretings

eb

Zhnujm
9th July 2004, 14:51
Originally posted by Moitah
.... Also I plan to allow the field order flag to be modified for interlaced encodes.

That would be really useful as xvid does not offer such option during encoding.

SeeMoreDigital
9th July 2004, 15:19
Originally posted by Moitah
@SeeMoreDigital: I'm not really interested in messing with MPEG 1/2. Oh well... Just a thought!

Originally posted by Moitah
I would like to do some stats in the next version, including B-VOP/QPel/GMC information (yes, I believe I will be able to determine the number of warp points). Great news!

Originally posted by Moitah
Also I plan to allow the field order flag to be modified for interlaced encodes. This would be clever!

Have you got something up your sleeve that can half the frame rate (ie: throw out the duplicate frames) from 60fps 720p encodes?


Cheers

Moitah
9th July 2004, 16:23
Originally posted by SeeMoreDigital
Have you got something up your sleeve that can half the frame rate (ie: throw out the duplicate frames) from 60fps 720p encodes?Nope, can't throw away frames since they are predicted from eachother. Why would a 60fps 720p encode have duplicate frames? Maybe if all the dupes were N-VOPs, but I don't think this would be reliable.

SiXXGuNNZ
10th July 2004, 20:23
Originally posted by Moitah
Warns if the AVI is OpenDML

I got an opendml avi because my avi is over 2gb(backing up to dvd), can I split the file in half, modify the aspect ratio in both files and join the back together and have it work? or do I need to do something else?

Moitah
11th July 2004, 00:11
Originally posted by SiXXGuNNZ
I got an opendml avi because my avi is over 2gb(backing up to dvd), can I split the file in half, modify the aspect ratio in both files and join the back together and have it work? or do I need to do something else? I haven't tried this, but I think it will work fine.

SiXXGuNNZ
11th July 2004, 03:15
Originally posted by Moitah
I haven't tried this, but I think it will work fine.

yep, it works just fine, so that is good news :)

SeeMoreDigital
27th August 2004, 10:18
Hi Moitah,

Hey there best friend, buddy, Pal, demi-god....

Would it be possible to make a version of this tool that can support different containers... such as MKV and (my personal favourite) .MP4?


Just curious!