View Full Version : StaxRip how to make divx-home certified stream with xvid encraw?
martynuzza
17th September 2018, 14:23
I found this document that explain the limits of each profile of divx certified logo.
http://www.divx.com/files/DivX-Profiles_Tech-Specs.pdf
I want to make compliant AVI using staxrip and xvidencraw, with the best settings possible.
For example i can't understand if i respect maximum value for
Macroblocks [40 500 bps]
VBV Buffer [384 kB]
VBV Bitrate [4854 kbps]
https://i.imgur.com/JdOsjH6.png
The string in staxrip that i try to build is (for CQ encoding):
xvid_encraw -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 40500 ?? -cq 2 -smoother 0 -max_key_interval 250 -vhqmode 4 -bvhq -quality 6 -qtype 0 -masking 2 -nopacked -max_bframes 1 -bquant_ratio 162 -bquant_offset 0 -threads 1 -i "%script_file%" -avi "%encoder_out_file%" -par %target_sar%
-vbvpeak is macroblocks?!
Is the right way to proceed ?!
SeeMoreDigital
17th September 2018, 18:52
Wow... Out of interest, what's the make and model of your hardware player?
martynuzza
17th September 2018, 19:32
Not for me. For friends and people that has old panasonic\lg or systems like integrated tv and projector with usb that can't reproduce anything else than avi-divxhome.
For now, i kept a WinXP machine for doing the job using the lastest DivX codec 6.8.5 and old staxrip, but now i upgraded to win10 and i want a more simple integrated and flawless workflow. Staxrip accomplish my needs very well but new version doesn't have vfw (so divx) anymore.
I've made some encodings for test with standard settings for xvid and try to reproduce to a "strict" projector...not work...( maybe because the FourCC..i'm not investigate further...)
SeeMoreDigital
17th September 2018, 19:55
If you require compatibility with old gear you're probably better off generating 'SP' (Simple Profile) encodes (ie: encodes without b-frames). 'MPEG4 SP (Simple) @L5' should work okay...
If the old gear can handle 'ASP' (Advanced Simple Profile) encodes with b-frames, try generating encodes with one (not two or more consecutive) b-frames(s). And select the 'Packed bit-stream' option.
blob2500
18th September 2018, 23:33
-vbvpeak is macroblocks?!
No, isn't macroblocks.
Macroblock is video resolution dependent:
Macroblock rate [Mbs/sec] = Resolution/(macroblock dimension)*frame rate.
For Xvid/Divx Home profile (up to) 40500 mbs/sec = (720*576)/(16*16)*25 for PAL videos; (720*480)/(16*16)*30 for NTSC videos.
vbvpeak is "Max bits over any one second interval" in Xvid interface (your posted image). For Home Profile, it's "8000000" (not 40500).
I'm not sure, but vbvpeak is not very important (is for codec internal check only) and in official MPEG-4 SP/ASP profiles is absent. VBVpeak is satisfied already with others vbv parameters: Max bitrate and Buffer size of Home profile.
In Divx Profiles table in your post, matrix for Home Teather is, theoretically, h.263 only, but you can to use MPEG matrix too, "standard" (not "custom"). MPEG standard and H.263 are fully Standalone player compatible.
Note: That table I think is not fully correct: example: VBV size of HD 720p profile is not 2048 kB (this is for 1080p only); actually it is 768 kB (9708 kbps double bitrate of HT profile... so must be double size of HT vbv size too ;) ) In Xvid interface all these values are correct for 'equivalents' DivX profiles too.
martynuzza
19th September 2018, 13:41
ook
Now, what about...that?
-nopacked
-max_bframes 1
XviD VFW interface keep no restriction on that but should do so.
I remember that the bitstream should to be, instead, packed and with only 1 b-frame allowed at maximum.
...
I tried a sample conversion with DivX Converter with codec 6.8.5 and him makes a packed bitstream...so this should be the correct way.
Right?
SeeMoreDigital
19th September 2018, 14:15
If the playback devices are only able to support MPEG-4 SP/ASP streams with b-frames placed within the .avi container, ideally you will need to use 'pack bit-stream'.
However, if the playback devices are able to support MPEG-4 SP/ASP streams with b-frames placed within the .mp4 container, you wont need to use 'pack bit-stream'.
If you haven't done-so already, try creating some short .avi and .mp4 test sample files.
That said, if I can find them, I might be able to provide you with some short .avi and .mp4 test sample files...
Cheers
martynuzza
19th September 2018, 15:56
Only AVI :D Only Packed :D just tried :D
In summary, the correct string is (i made some small personal modification with zones)
xvid_encraw -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -max_bframes 1 -qtype 0 -cq 2 -smoother 0 -vhqmode 4 -quality 6 -masking 2 -bvhq -bquant_ratio 162 -bquant_offset 0 -zones 0,w,1.0,O -i "%script_file%" -avi "%encoder_out_file%" -par %target_sar%
For now it's ok but I'll have to write to the author of staxrip to ask him how to activate the 2-pass mode...this is another story
:thanks:
blob2500
20th September 2018, 01:39
I remember that the bitstream should to be, instead, packed and with only 1 b-frame allowed at maximum.
It's true for DivX Home profile full compatibility. 1 b-frame + Packed Bitsream is safest choice.
Every old Standalone Player support 2 consecutive b-frame too, but the problem is combination of 2 b-frames with (or without) Packed Bitstream. Almost all support 2 B-frame without PB; others support 2 B-frame but with PB.
Revan654
20th September 2018, 05:00
Only AVI :D Only Packed :D just tried :D
In summary, the correct string is (i made some small personal modification with zones)
For now it's ok but I'll have to write to the author of staxrip to ask him how to activate the 2-pass mode...this is another story
:thanks:
He's retired, I think I'm the only one who has added functions to the code since.
It should be:
-pass1 [file]
-pass2 [file]
-pass1full is disabled.
Doesn't the help function enable when you click on it?
martynuzza
20th September 2018, 15:15
Doesn't the help function enable when you click on it?
mmmmmmmm :scared: what?
hmm...which parameters? :confused: i can't understand how xvid_encraw get the parameters of pass1 to create final pass2
https://i.imgur.com/rVvAWRg.png
For example, bitrate at 1800kbps, is correct the syntax?
xvid_encraw -pass1 TEST.PASS_1 -max_bframes 1 -qtype 0 -bitrate 1800 -smoother 0 -max_key_interval 250 -vhqmode 4 -quality 6 -masking 2 -bvhq -bquant_ratio 162 -bquant_offset 0 -zones 0,w,1.0,O -i "%script_file%" -par %target_sar%
xvid_encraw -pass2 TEST.PASS_1 -vbvsize 3145728 -vbvmax 4854000 -vbvpeak 8000000 -max_bframes 1 -qtype 0 -bitrate 1800 -smoother 0 -max_key_interval 250 -vhqmode 4 -quality 6 -masking 2 -bvhq -bquant_ratio 162 -bquant_offset 0 -zones 0,w,1.0,O -i "%script_file%" -avi "%encoder_out_file%" -par %target_sar%
Revan654
20th September 2018, 19:40
mmmmmmmm :scared: what?
hmm...which parameters? :confused: i can't understand how xvid_encraw get the parameters of pass1 to create final pass2
https://i.imgur.com/rVvAWRg.png
For example, bitrate at 1800kbps, is correct the syntax?
It's been ages since I actually used XviD, I'm a bit rusty when using XviD.
It should be something like this
-pass1 src.pass
-pass2 src.pass -avi dst.avi
or with macro
-pass2 src.pass -avi "%encoder_out_file%"
Only the second pass requires the -avi and .avi file location output.
The encoder will pull in the .pass file which contains all the needed information. First pass writes to .pass and second pass reads the .pass.
------
You can also use ffmpeg XviD as well, with does most of the work for you already. It has 2-pass mode built in and will add the proper flags for the passes.
SeeMoreDigital
20th September 2018, 21:23
Hi @martynuzza,
How about looking at different encoder GUI's. MeGUI (https://forum.doom9.org/showthread.php?t=153904) has plenty of support on this forum and offers an XviD 'scratchpad' encoding option ;)
martynuzza
25th September 2018, 08:13
mmm I never used megui, seems to be a good program, I downloaded it and I'm trying it; at first sight I can't see filter preview or a function to add hardcoded subtitles or a setting to select a custom drc compression level in audio. I think I will use it :)
Also I noticed that staxrip has the old codec xvid 1.3.3 instead of 1.3.5; I tried to overwrite the new version over but brings to error for complaining about missing yv12 input
Revan654
25th September 2018, 19:40
mmm I never used megui, seems to be a good program, I downloaded it and I'm trying it; at first sight I can't see filter preview or a function to add hardcoded subtitles or a setting to select a custom drc compression level in audio. I think I will use it :)
Also I noticed that staxrip has the old codec xvid 1.3.3 instead of 1.3.5; I tried to overwrite the new version over but brings to error for complaining about missing yv12 input
StaxRip already uses 1.3.5, If you have 1.3.3 you must have downloaded a older build of StaxRip.
xvidcore build version: xvid-1.3.5
Bitstream version: 1.3.5
I found MeGui way to limited, when it comes to filters & Encoding. After all these years x64 version is still listed as a test build. :p
Hybrid & StaxRip were always my go to Encoders. I mainly use Hybrid on Linux(One few Encoders that's fully support in Linux). With StaxRip being my Main Windows Encoder.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.