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. |
|
|
Thread Tools | Search this Thread | Display Modes |
31st March 2004, 10:18 | #1 | Link |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
HowTo create Variable Framerate MPEG-4 video streams in MP4
as most of you might propably already know its possible to create variable framerate video streams with mpeg-4 video
the fact why it is often not used is probably caused by the crappy avi container, which (apart from many other issues) is not able to store real variable framerate streams now with the upcoming of far more advanced containers (like matroska and mp4) able to handle vfr, i think we should explore the possibilites of vfr far more (and i hope i can encourage some people to help me with my currently ongoing testings): as avi and vfw (used by xvid and divx5 in vdm) doesnt seem to be able to handle vfr at all there are two possibilities to create vfr mpeg-4 video streams 1) use a directshow encoder, like the one from 3ivx (suxendrol is already working on a xvid dshow enc filter) and dont even think about touching crappy outdated avi and vfw 2) use vfw encoders, with avi workarounds, and do some smart avi->mp4 conversions: the xvid encoder already offers the so called "frame drop ratio": with a setting of 0 only frames get dropped which are 100% the same as the frame before, with 100 all frames are dropped this option's name and description might be a little misleading as the frames arent really totally dropped (leading to vfr or less frames in the output), also a value of 50 doesnt mean that every second frame is affected -> frames get simply not coded, which means so called n-vops are placed in the stream this value specifies a threshold under which, if the difference of the following frame to the previous frame is below or equal to this threshold, a frame gets not coded (see it could even be that you set a value of 50, but still no frame gets not coded) on the decoder side, everytime when the decoder comes to such a n-vop, it displays the frame before the n-vop again, therefore its some sort of "fake vfr stream" now with the 3ivx or MP4Box MP4 muxers these n-vops can be really dropped and real vfr mpeg-4 streams get created inside the mp4 container small howto 1) open your to-encode source in virtualdubmod 2) go to the xvid codec settings and choose the settings as you wish and set the frame drop ratio you want to use (on my testssample it seemed that i didnt get a dropped frame with a value of 15, with 90 there were (of course) far too much dropped frames) also it seems that the frame drop ratio seems to work better when packed bitstream (b-frames) is disabled now you can decide whether you want to use the commandline MP4Box or the 3ivx directshow muxer to create a VFR MP4 file: MP4Box: 3) download mp4box from rarewares 4) run the following commandline: Code:
MP4Box -import myavi.avi mymp4.mp4 3) install 3ivx 4) open the resulting avi in graphedit 5) remove all filters, except the source and the avi splitter, load the 3ivx mp4 muxer and the file writer (*.mp4) and connect the 3ivx muxer between avi splitter and file writer 6) enable the "compress n-vops" option in the 3ivx muxer and push play you should now be able to enjoy and play the created variable frame rate mp4 file with every mpeg-4 decoder (xvid, divx5, ffdshow, 3ivx etc...) in any dshow based player without loosing sync with the audio aso... edit: note that during my testings i found that the frame drop ratio was broken in the current release candidates (koepis rc3). syskin now fixed some bugs but it seems that there are still "unfixable" problems when using it with b-frames therefore the frame drop option in xvid will only work without b-frames from now on edit2: added gpac's mp4box, as it offers exactly the same features as 3ivx now too
__________________
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; 9th May 2004 at 08:59. |
7th April 2004, 10:16 | #2 | Link |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
ok some test results on how/if mpeg-4 codecs will create not coded frames (n-vops) when two frames are the same/similar:
1) xvid (tested rc4, till rc3 no n-vops were created with the default settings (framedrop ratio on 0)!!) - when b-frames are disabled xvid will create n-vops even if the framedrop ratio is set to 0 (which means it only drops frames that are 100% the same) a higher value will lead to that even frames which are not 100% the same can be dropped - with b-frames enabled it doesnt output n-vops 2) 3ivx (4.5.1) outputs n-vops 3) nero digital (first version), with and without b-frames, outputs n-vops 4) divx5 (5.1.1) doesnt output n-vops 5) ffvfw (20031117) doesnt output n-vops with the default settings (i didnt find an option which could enable n-vops creation)
__________________
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; 7th April 2004 at 10:43. |
7th April 2004, 11:10 | #3 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
|
Sounds interesting.
Have you any short examples you can provide a link to? I guess 2 encodes would be needed. One with variable frame rate and one without! Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
7th April 2004, 11:41 | #4 | Link | |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
Quote:
simply encode a still (anime) or black scene with 3ivx or with xvid (without b-frames) and transmux with the 3ivx muxer you can checkout with mp4ui if the stream is vfr (for example if the framerate shown is not the same as the input one of course) during playback you will not see a difference
__________________
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 |
|
7th April 2004, 13:31 | #5 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
did I get it right now:
The framdrop ratio is a threshold how much a frame from his predecessor is allowed to differ to be dropped (coded as n-vob) ? So a ratio of e.g. 0.1-1% shouldn't do much harm in normal movie? (is it even possible to enter values like 0.1?) Cu Selur |
7th April 2004, 13:39 | #6 | Link | ||
Registered User
Join Date: Nov 2001
Posts: 9,770
|
Quote:
it also depends on the chosen bitrate i think (therefore i am not sure how xvid/3ivx measures the differences between two frames) Quote:
with a value of 15 i didnt get a frame drop with rc3 (which was buggy tough)
__________________
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 |
||
9th April 2004, 00:26 | #9 | Link |
Find the words to say.
Join Date: Jan 2002
Location: Fantasy Land
Posts: 133
|
this is fine and well but without B-Frames is this even worth the bother?
Wouldnt you prefer to have all frames using B-Frames than missing frames? in a world where everybody seems to be trying to get the smoothest playback...this almost seems like a step backwards. im off to give it a shot...who knows, but i dont think it is for ME. (Unless you can still have B-Frames someday)
__________________
"It's too bad she won't live. But then again who does" - Gaff |
9th April 2004, 00:35 | #10 | Link | |
Registered User
Join Date: Dec 2002
Location: Great White North
Posts: 522
|
Quote:
|
|
9th April 2004, 00:44 | #11 | Link |
Registered User
Join Date: Dec 2001
Posts: 987
|
The vfw "Cartoon mode" (which I've found is not the same as what xvidcore considers Cartoon Mode) is *supposed* to create more n-blocks, and I guess therefore more n-frames, but it doesn't seem to work. The core has these two functions seperate and considers vop_cartoon exclusively as Cartoon Mode. At least, that's what the comments indicate :|
So I'd like to say that it doesn't drop frames, but I'm really not sure at this point. |
4th May 2004, 20:44 | #12 | Link |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
i added MP4Box to the guide as it now also handles the detection and removal of encoder dropped N-VOPS and the outputting of a VFR MP4 in the same way as the 3ivx muxer
__________________
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 |
29th July 2004, 19:46 | #13 | Link |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
i now tested divx5, the latest ffdshow (using libav) and 3ivx (with b-frames and without), whether they place n-vops in the stream...
divx5 and ffdshow still dont do this, 3ivx does it even with b-frames
__________________
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 |
19th August 2004, 12:53 | #14 | Link |
Hybrid material critic
Join Date: Jun 2004
Location: Cyberland in Japan
Posts: 140
|
Does the display interval of a frame differ from RV10 DropDupe?
RV10 DropDupe (I think): +----+----+----+----+---------+ drop! and a front frame stays on True VFR: +-----+-----+-----+-----+-----+ drop! and equally spaced in the section 3ivx: ????? I want True VFR...
__________________
lunaticmoon in CyberLand |
3rd October 2005, 18:11 | #16 | Link |
<The VFW Sheep of Death>
Join Date: Dec 2004
Location: Deathly pasture of VFW
Posts: 1,149
|
Yes, this was a more than a year ago and it still doesn't have B-frames.
There was a test version that had them (look at the latest Doom9 codec shootout), but I have no idea why it hasn't been released yet. Come on, 3ivX5!
__________________
Recommended all-in-one stop for x264/GCC needs on Windows: Komisar x264 builds! |
3rd October 2005, 18:52 | #17 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
|
Yes....... whatever happened to 3ivx?
Some of the 3ivx guys used to regularly post on Doom9 and their beta looked promising! Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
4th October 2005, 01:13 | #18 | Link |
<The VFW Sheep of Death>
Join Date: Dec 2004
Location: Deathly pasture of VFW
Posts: 1,149
|
A lot more than just promising... Doom9's codec comparison showed that its performance was equal to DivX Fusion alpha at like 5 times the speed... faster than XviD even. And if that was about a year ago, imagine the quality now.
---------------------------------------------------------------------------- "Interesting indeed, Dr. House." "Oh really? What would you know, Matilda?"
__________________
Recommended all-in-one stop for x264/GCC needs on Windows: Komisar x264 builds! |
4th October 2005, 01:50 | #20 | Link |
<The VFW Sheep of Death>
Join Date: Dec 2004
Location: Deathly pasture of VFW
Posts: 1,149
|
Yes, don't even get me started on that wonderful filter set... It used to be the standard among many MPEG4 enthusiasts for muxing and splitting content in directshow.
Almost 2 years later, the filter suite is still experiencing heavy usage, despite its lack of updates (particularly in the AVC field). The 3ivX codec supported VFR, right? So its stands to reason that its filters support it as well. An update to them as well as the codec itself will surely be beneficial to many an-ASP enthusiast (or any user of MPEG-4 in general).
__________________
Recommended all-in-one stop for x264/GCC needs on Windows: Komisar x264 builds! |
Thread Tools | Search this Thread |
Display Modes | |
|
|