View Full Version : xvid_encraw - Patched with AviSynth input support
Pages :
1
2
[
3]
4
5
6
7
8
9
10
11
12
13
14
15
S_O
1st September 2005, 14:25
The framerate in my AVS was 23.976Are you sure? What has been displayed?
Oh, I think I have an possible explanation of what happend:
xvid_encraw has used 23,976 fps, no problems. But framerate is not stored in the bitstream, so when you mux it with mp4box, mp4box uses a default framerate of 25fps. You need to add "-fps 23.976" in the mp4box commandline.
Doom9
1st September 2005, 17:19
doesn't mp4box only pick up the framerate if you feed it with an mp4 containing video (or perhaps avi as well). iirc you always need to specify the framerate for raw content, regardless of whether the bitstream contains the framerate or not.
S_O
1st September 2005, 18:06
In avi or mp4 the bitrate is stored, so mp4box reads it when it opens such a file. But in raw m4v a bitrate is never stored. So mp4box uses default value of 25fps. In case you mux a raw-movie now with a framerate other than 25fps, you need specify this in the commandline using the -fps switch, otherwise the movie will have a wrong framerate of 25fps, and I think that´s exactly the problem that Isochroma has noticed.
JoeBG
16th September 2005, 12:51
Expect a new release in a few days, the commandline structure will change like proposed here.
Any new releases? Great projekt :thanks:
Doom9
20th September 2005, 08:29
since it seems to take longer than anticipated (hey, it happens), could you tell us which of the proposed schemes you're going to adopt so that I can start my preparations?
JoeBG
2nd October 2005, 12:24
Hi guys,
since 4 hours I´m testing my tesclip (885 frames) xvid_encraw. I get horrible pictures with the following skript and can´t improve it with ever I try:
echo Pass 1 Xvid
echo ************
echo.
xvid_encraw -i Film.avs -type 2 -asm -par PAL169 -quality 6 -pass1 Xvid.log -bitrate 1400 -max_bframes 2 -qpel -vhq 4 -turbo -z "q 800 40" -o Film.m4v
echo.
echo Pass 2 Xvid
echo ************
echo.
xvid_encraw -i Film.avs -type 2 -asm -par PAL169 -quality 6 -pass2 Xvid.log -bitrate 1400 -max_bframes 2 -qpel -vhq 4 -z "q 800 40" -o Film.m4v
JoeBG
2nd October 2005, 21:33
I found the mistake myself. If I rename "Xvid.log" to "statsfile" in both passes, everything works fine. I really don´t know why.
Edit:
Just one word to the tool: It´s great. Mencoder Xvid is slower and always creates too small outputs. But my first tests with xvid_encraw are all very good.
JoeBG
3rd October 2005, 08:42
Sorry guys, I´m testing the tool and there are two other questions coming up :)
-vhq, default is [1.4]. Does this mean a range between 1 and 4 and can I choose 4 like in vfw codec?
-quality 6: Which features does this include? All features with a "+" ? So that I can deaktivate them when I want? I´m interested in a complete list please. :)
Sorry for so many questions. But it´s agreat tool and I will use it correct :)
Yuri Khan
4th October 2005, 12:50
I've found a means to mux raw m4v into AVI so I'm all game for integrating encraw into MeGUI, but I'd like to have the commandline thing settled..
Could you please elaborate? Is it an external commandline muxer that accepts m4v input, or just an idea how to implement one?
To put it short, my typical use case is a series of 26 24-minute episodes, each of which has to be encoded in a separate file and wants an individual bitrate (sometimes up to 100% difference), but with all other settings common. So the only part of the encoder settings that changes is the stats filename and the target size. And I’m looking for a command line driven encoder that I could invoke from a generated batch file (or maybe even from a makefile).
For now, I see three candidates: (1) VirtualDubMod (but then I have to understand how it encodes the binary codec settings and to watch for settings changes when upgrading the codec); (2) mencoder (but it undersizes each episode by ~20MB); and (3) xvid_encraw which seems almost perfect but I need to find out what to do with raw m4v output.
JoeBG
4th October 2005, 17:20
...but I need to find out what to do with raw m4v output.
mux it into mp4 with mp4box or mux it into mkv with mkvtoolnix
Yuri Khan
4th October 2005, 18:15
-quality 6: Which features does this include? All features with a "+" ? So that I can deaktivate them when I want? I´m interested in a complete list please. :)
Judging by the source:
-quality 1 implies +me_advd16
-quality 2 adds +me_hpelr16 and +hpel
-quality 3 adds +me_advd8, +me_hpelr8, +inter4v, and if you’re using -qpel, then also +me_qpelr8
-quality 4 adds +chromap and +chromab
-quality 5 adds +trellis
-quality 6 adds +me_exts16, +me_exts8 and +hqacp
mux it into mp4 with mp4box or mux it into mkv with mkvtoolnix
And then remux into avi… I think I’d rather take a plunge into mencoder sources :)
Doom9
4th October 2005, 19:08
mencoder can mux raw ASP streams into an avi.. the commandline is the same as what megui uses for the AVI muxer, just with an .m4v instead of an .avi input. Once encraw is ready to be incorporated, I'll unlock the filetype selector in the avi muxer to make it possible to directly mux in MeGUI. even raw AVC muxing should be possible, but due to yet another bug in mencoder, only if you specify the FPS of the source.
Yuri Khan
4th October 2005, 20:09
Heh, figured it out too…
mencoder -ovc copy -ffourcc XVID test.m4v -o test.aviSomehow, without -ffourcc, it puts FMP4 in the headers.
Not that I’m happy with using a sophisticated tool like mencoder for mundane muxing tasks, but hey, if it works, why not :)
Beave
5th October 2005, 23:36
to mix the raw file into avi with mencoder I tried the cli from megui:
"mencoder.exe" "test.m4v" -ovc copy -oac copy -audiofile "test.ac3" -mc 0 -noskip -o "test.avi"
It just stops without ending. I guess I need to add framerate and Aspect information to the commandline, right?
Yuri Khan
9th October 2005, 12:28
@Beave:
You need to specify the audio parameters such as bitrate, sample rate and channel count. Interestingly, you can get the required information with mplayer:
mplayer.exe -frames 0 -identify test.ac3and watch for lines starting with:
ID_AUDIO_BITRATE
ID_AUDIO_RATE
ID_AUDIO_NCHYou then issue a command like this:
mencoder.exe -ovc copy -oac copy -audiofile test.ac3 -audio-demuxer 20 -demuxer lavc -rawaudio format=0x2000 -rawaudio bitrate=384000 -rawaudio channels=6 -rawaudio rate=48000 test.m4v -ffourcc XVID -o test.avisubstituting your own values for 384000, 6 and 48000.
@Doom9:
I have found that, with most raw XviD .m4v files, mencoder selects libavformat demuxer and the resulting avi is all right, but some files are identified as MPEG4-ES. In the latter case, it produces an avi file whose headers contain zeros in the video width and height fields. It is not exactly b0rked, as mplayer still can play them; but also not completely compatible as, for example, Media Player Classic refuses to render such 0×0 files. Thus, I suggest that the switch -demuxer lavf be used explicitly to select libavformat demuxer, which passes the correct width and height to the muxer.
Doom9
21st October 2005, 21:04
@S_O: any news?
naysayer
30th October 2005, 20:23
I have a feature request: output to stdout.
I used to pipe avs2yuv to ffmpeg via stdin/stdout, with no temp file, to save to avi like this:
avs2yuv 1.avs - | ffmpeg -f yuv4mpegpipe -i - 1.avi
I've been using xvid_encraw now, and saving with "-o out.m4v", and then using mencoder or ffmpeg to mux into an avi.
What would be great though, is if I could avoid the temp m4v file and pass the video to ffmpeg like I used to with avs2yuv, like:
xvid_encraw -i 1.avs -o - | ffmpeg -f rawvideo -i - 1.avi
I tried variations of "xvid_encraw -i 1.avs -o -" already, and it only writes to disk with a file named " - "...
708145
30th October 2005, 23:33
I have a feature request: output to stdout.
I used to pipe avs2yuv to ffmpeg via stdin/stdout, with no temp file, to save to avi like this:
avs2yuv 1.avs - | ffmpeg -f yuv4mpegpipe -i - 1.avi
I've been using xvid_encraw now, and saving with "-o out.m4v", and then using mencoder or ffmpeg to mux into an avi.
What would be great though, is if I could avoid the temp m4v file and pass the video to ffmpeg like I used to with avs2yuv, like:
xvid_encraw -i 1.avs -o - | ffmpeg -f rawvideo -i - 1.avi
I tried variations of "xvid_encraw -i 1.avs -o -" already, and it only writes to disk with a file named " - "...
what about named pipes? they work under cygwin at least.
bis besser,
T0B1A5
708145
31st October 2005, 00:32
Is -frames ignored in avs mode?
And a related question: could -start be added as well as in x264.exe?
That would help me a lot with ELDER :)
P.S.: What's the status on avi output? If it's not planned then I have to ship ffmpeg with ELDER... just want to avoid depending on too many tools.
bis besser,
T0B1A5
JoeBG
2nd November 2005, 18:36
@S_O: any news?
Any News?
Doom9
2nd November 2005, 20:52
I know S_O is still around but not posting anymore. Sad :(
JoeBG
5th November 2005, 10:04
I know S_O is still around but not posting anymore. Sad :(
He is preparing something special I hope :yes:
mirthandir
7th November 2005, 15:25
When I compile and run the xvid_encraw.cpp posted it throws an exception
LN 1004: "res = env->Invoke("Import", AVSValue(&arg, 1));"
Anybody have any suggestions? Is there something moronic that I'm missing?
JoeBG
13th November 2005, 08:56
Any news?
Zero1
17th November 2005, 21:34
It's great to be able to finally use encraw :)
I was going to make some anamorphic ASP in MP4, for some testing, and I came across this weird error. To try and eliminate the cause I re-encoded it without the AR tag.
I was wondering if there are any knowns errors, or perhaps someone could tell what the problem is by looking at it and suggest disabling a feature manually?
This is the command I am using:
xvid_encraw.exe -i "Video1.avs" -framerate 23.976 -type 2 -w 704 -h 480 -quality 6 -vhq 4 -chroma_opt -max_bframes 2 -bitrate 1500000 -pass2 stats.log -max_key_interval 240 -iquants 2 31 -pquants 2 31 -bquants 2 31 -o "test2.m4v"
And here is the "artifact" (not so much of an artifact, just looks like b0rked Macroblocks?).
http://img420.imageshack.us/img420/6896/encrawblocks6wj.th.jpg (http://img420.imageshack.us/my.php?image=encrawblocks6wj.jpg)
(That was made using directshowsource)
Many thanks
JoeBG
3rd December 2005, 18:41
Still hoping for an update :)
Doom9
3rd December 2005, 19:01
Me too - I'd love to use this in megui to offer the full featureset of xvid, but it looks like somebody else has to start coding.
Kopernikus
3rd December 2005, 19:41
Is there anything else than zones for enc_raw that I didnt see when looking through the thread?
I think zones could easy be implemented as a plugin, but I don't know if I have time to try it.
Doom9
3rd December 2005, 20:03
zones are included.. it's just the syntax that is a bit weird. S_O said he was going to change it - then nothing ever happened...
Kopernikus
3rd December 2005, 20:51
is the syntax proposed by BrotherJohn the one that should be implemented?
Doom9
3rd December 2005, 21:14
I still insist the one I proposed (which corresponds to syntax other codecs use) is better. Are you volunteering to finishing encraw? I would except I have no time (there will be a new codec comparison, and when I have time I should continue working on MeGUI) and don't like C (and I don't suppose you could do this project in Visual Studio).
JoeBG
4th December 2005, 02:45
For me there is still the open question with the stats file. You have to give the the stats file of the second pass another name than the one of the first pass. This looks like as if the stats file of the first pass is not used in the second pass. I tested this and if you only make a second pass ( without any first pass) the quality is the same as if you make a first pass and a second pass. => The first pass with xvid_encraw seems to be totally useless. Can someone confirm?
Zero1
4th December 2005, 11:09
Syntax like the ones used in x264.exe CLI would be absolutely ideal in my opinion.
Any comments on my messed up screenshot yet guys?
Cheers :)
JoeBG
4th December 2005, 13:53
Syntax like the ones used in x264.exe CLI would be absolutely ideal in my opinion.
Any comments on my messed up screenshot yet guys?
Cheers :)
Where is your total commandline? No first pass is used?
Zero1
5th December 2005, 00:16
This wasn't the command I used at the time (since then I've edited my batch and lost the settings) but these settings reproduce the problem.
xvid_encraw.exe -i "Video1.avs" -framerate 23.976 -type 2 -w 704 -h 480 -quality 6 -vhq 4 -chroma_opt -max_bframes 2 -bitrate 1500000 -pass1 stats.log -max_key_interval 240 -iquants 2 31 -pquants 2 31 -bquants 2 31 -o "test1.m4v"
xvid_encraw.exe -i "Video1.avs" -framerate 23.976 -type 2 -w 704 -h 480 -quality 6 -vhq 4 -chroma_opt -max_bframes 2 -bitrate 1500000 -pass2 stats.log -max_key_interval 240 -iquants 2 31 -pquants 2 31 -bquants 2 31 -o "test2.m4v"
Yes, the first file was 2 pass, the line I posted was from the second pass. IIRC the first pass was identical except for --pass and the output was to a different file. It still used the same log file as pass 2 though.
Thanks :)
JoeBG
5th December 2005, 18:56
This wasn't the command I used at the time (since then I've edited my batch and lost the settings) but these settings reproduce the problem.
xvid_encraw.exe -i "Video1.avs" -framerate 23.976 -type 2 -w 704 -h 480 -quality 6 -vhq 4 -chroma_opt -max_bframes 2 -bitrate 1500000 -pass1 stats.log -max_key_interval 240 -iquants 2 31 -pquants 2 31 -bquants 2 31 -o "test1.m4v"
xvid_encraw.exe -i "Video1.avs" -framerate 23.976 -type 2 -w 704 -h 480 -quality 6 -vhq 4 -chroma_opt -max_bframes 2 -bitrate 1500000 -pass2 stats.log -max_key_interval 240 -iquants 2 31 -pquants 2 31 -bquants 2 31 -o "test2.m4v"
Yes, the first file was 2 pass, the line I posted was from the second pass. IIRC the first pass was identical except for --pass and the output was to a different file. It still used the same log file as pass 2 though.
Thanks :)
So you have the same problem like me. Give the statsfile of the second pass another name and it will look better. But you (and me) will never know if the first pass was totally useless.
Doom9
6th December 2005, 22:51
It seems encraw in the CSV has been updated as well and it should support all options available in the VfW except the profiles, and AviSynth input. So fire up your compilers ladies and gentlemen.
Kopernikus
6th December 2005, 23:05
I dont see any changes in the CVS. The last update of encraw dates 8 weeks ago. (at least here :))
JoeBG
7th December 2005, 19:41
Sorry for pointing this again:
Xvid Encraw ist useless because it does not use the statsfile of the first. Can someone confirm this?
Doom9
7th December 2005, 19:48
well, Isibaar told me what I posted here.. I'm sure I'll get a copy shortly to check this for myself and since I'm using MP4 for the next codec comparison, I plan to use the commandline encoder rather than the VfW encoder if somehow possible.
JoeBG
9th December 2005, 19:53
well, Isibaar told me what I posted here.. I'm sure I'll get a copy shortly to check this for myself and since I'm using MP4 for the next codec comparison, I plan to use the commandline encoder rather than the VfW encoder if somehow possible.
Sorry for bagging you so soon. Any news?
Doom9
9th December 2005, 19:55
when the time comes you'll know... it is not up to me to release unreleased software.
JoeBG
9th December 2005, 20:10
when the time comes you'll know... it is not up to me to release unreleased software.
But it´s hot news. So please keep us informed - thank you :)
sysKin
10th December 2005, 05:55
Hi, what's the current status of xvid_encraw? I volunteer to add anything I can add - this weekend if needed. What's left/broken/wrong? Any patches waiting to be checked in?
Doom9
10th December 2005, 11:42
@syskin: you might wanna talk to Isibaar about that.
@JoeBG: I run a news site so you can bet you'll know when I have something to share.
Sagittaire
10th December 2005, 11:43
Hi, what's the current status of xvid_encraw? I volunteer to add anything I can add - this weekend if needed. What's left/broken/wrong? Any patches waiting to be checked in?
cool ... :cool:
1) psnr calculation
2) it's xvid_encoraw but mp4 output could be great
3) all possible advanced ME search
4) multipasse encoding : we can use pseudo multipass with XviD vfw and zone option. For example if my final average quant encoding is ~q4 I use q4 for first pass in zone option. First pass -> write 1pass.log, second pass -> read 1pass.log and write 2pass.log ... etc
bond
10th December 2005, 12:30
basically enabling all xvid options in the cli would be great (you can use S_Os code as a startpoint)
.mp4 output, well ;) you can use mpeg4ip's or gpac's lib which are save (mpeg4ip has a xvid cli outputting mp4 in their cvs, which might be a modified encraw?)
.avs input
Doom9
10th December 2005, 12:45
guys, please. I have it on good authority that encraw is done (except for the profiles you can select in the GUI), it would make little sense for syskin to re-invent the wheel.
bond
10th December 2005, 12:47
guys, please. I have it on good authority that encraw is done (except for the profiles you can select in the GUI), it would make little sense for syskin to re-invent the wheel.with .mp4 output and .avs input?
Doom9
10th December 2005, 13:05
I doubt there's mp4 output. But if anybody were going to add that, it's better to wait until the CSV code (I don't know why you can't see it.. is there a shadow CSV? In the past year I've not seen much of activity anywhere so I'm wondering if development has moved to channels I'm not aware). Anyway, the submission deadline for codecs is the 16th so by that time I should have that encraw and if it's ready for release it will show up here as well.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.