Log in

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

JoeBG
26th June 2006, 19:09
@ shpitz

Just tested it only for you :) (I never use fast forwarding) and it works great. I always use ZoomPlayer with HaaliSplitter and ffdshow for xvid and aac. I mux the video with mp4box.

shpitz
26th June 2006, 20:27
@ shpitz

Just tested it only for you :) (I never use fast forwarding) and it works great. I always use ZoomPlayer with HaaliSplitter and ffdshow for xvid and aac. I mux the video with mp4box.

haha, thanks m8, i guess i'll give it a shot. i'm using MPC myself.

MatMaul
18th July 2006, 08:37
I have a problem with the mkv output of xvid_encraw (the version of megui).
I can play the mkv in mpc but it's horrible in vlc (macroblock).

If I use the raw output and I remux it in mp4 with mp4box I have an error : the file is playable but not seekable.

If I use the xvid_encraw of celtic druid, no problem with raw output (good mux in mp4), but it doesn't support mkv output.

I tried to compile my own version of xvid_encraw with mkv output but I can't find the needed file "matroska.cpp" in the source of matroska or mkvtoolnix : I just find a file "r_matroska.cpp" in mkvtoolnix source. Where I can find the file please?

EDIT : all the squid80's modifications are committed to the cvs of xvid project or not ?
EDIT2 : I have found matroska.cpp, I tried to compile my own build and I report the results

bond
18th July 2006, 18:50
If I use the raw output and I remux it in mp4 with mp4box I have an error : the file is playable but not seekable.what player? try another player

MatMaul
18th July 2006, 20:43
sorry you are right, it's my version of mp4box the problem.

but the mkv problem exists and I don't think it's related to the player (vlc), because raw->mp4->mkv works good.

I can't compile a version with mkv support, I don't now how to do that.

holzi
19th July 2006, 12:15
I don't know if the problem was already posted coudn't find anything.
I get a strange result when encoding in 2 pass mode.
It's done by megui:
Here the log:


encoder commandline:
-i "O:\DVD-out\Temp\fight.avs" -pass1 "O:\DVD-out\Temp\fight.stats" -bitrate 1076 -kboost 100 -overhead 0 -max_key_interval 250 -vhqmode 4 -closed_gop -threads 1
successfully started encoding
Processing ended at 01:33:44
----------------------------------------------------------------------------------------------------------

Log for job job1

xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003


Tot: enctime(ms) =2545641.00, length(bytes) = 821595521
Avg: enctime(ms) = 12.72, fps = 78.62, length(bytes) = 4104
I frames: 2508 frames, size = 17424/43701787, quants = 2 / 2.00 / 2
P frames: 73684 frames, size = 8340/614550880, quants = 2 / 2.00 / 2
B frames: 123908 frames, size = 1318/163342488, quants = 4 / 4.00 / 4
N frames: 46 frames, size = 7/ 366
Trying to retrieve width and height from input header
Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE 3DNOW 3DNOWEXT TSC
Detected 1 cpus, using 1 threads.

----------------------------------------------------------------------------------------------------------
Job completed successfully and deletion of intermediate files is activated
Starting job job2 at 01:33:44
encoder commandline:
-i "O:\DVD-out\Temp\fight.avs" -pass2 "O:\DVD-out\Temp\fight.stats" -bitrate 1076 -kboost 100 -overhead 0 -max_key_interval 250 -vhqmode 4 -closed_gop -threads 1 -avi "O:\DVD-out\Temp\fight.avi"
successfully started encoding
Processing ended at 04:42:15
----------------------------------------------------------------------------------------------------------

Log for job job2

xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003

Trying to retrieve width and height from input header
Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE 3DNOW 3DNOWEXT TSC
Detected 1 cpus, using 1 threads.

Tot: enctime(ms) =5988780.00, length(bytes) = 770489159
Avg: enctime(ms) = 29.92, fps = 33.42, length(bytes) = 3849
I frames: 2508 frames, size = 17244/43249140, quants = 2 / 2.00 / 2
P frames: 73684 frames, size = 7516/553839680, quants = 2 / 2.00 / 2
B frames: 123953 frames, size = 1398/173400333, quants = 4 / 4.00 / 4
N frames: 1 frames, size = 6/ 6
desired video bitrate of this job: 1076 kbit/s - obtained video bitrate (approximate): 774 kbit/s


Why doesn't encraw use the hole bitrate of 1076?

My avs script I used:

DGDecode_mpeg2source("O:\DVD-out\Temp\VTS_01_1.d2v",info=3)
ColorMatrix(hints=true)
#Not doing anything because the source is progressive
crop( 0, 74, 0, -76)

LanczosResize(576,240) # Lanczos (Sharp)
Undot() # Minimal Noise

foxyshadis
19th July 2006, 13:10
I frames: 2508 frames, size = 17244/43249140, quants = 2 / 2.00 / 2
P frames: 73684 frames, size = 7516/553839680, quants = 2 / 2.00 / 2
B frames: 123953 frames, size = 1398/173400333, quants = 4 / 4.00 / 4


You're already maxing out the codec quality, anything more is just throwing bits away. Assuming you'd rather increase quality than simply add a hundred megs of padding, at the very least use MPEG matrix, or check out the xvid presets thread and load the presets into megui. Use one of the higher ones.

MatMaul
21st July 2006, 23:33
lol I ever have problem with the output of xvid_encraw.

If I use the direct mkv output, problem to play the file in vlc (big macroblock on the video).

If I do m4v->mp4->mkv, no problem with vlc BUT problem with the ordered chapters function in mkv,an example : I want to display the first 30s of a video, then I want to see the last 30s of the video (the video is longer than 1mn) and I do that with ordered chapters (=>the timeline have a length of 1mn and the real video have a length > 1mn). No problem with the first 30s, but when the player seek to the last 30s of the video, big freeze of the video.
I have test with some couple of mp4box/mkvmerge, same problem.
And I don't have this problem with mkv direct output.

any idea to have a correct display in vlc and ordered chapters function ?

Do you think anyone can modify mkv output to have a good picture in vlc, or it's a vlc problem ?

Thanks !

Adub
29th July 2006, 03:18
Yo, Squidy, whats with the new version that you updated today?

bug fixes, enhancements, what?

squid_80
29th July 2006, 05:11
Neater error reporting and dynamic linking with xvidcore.dll.

MatMaul
29th July 2006, 09:50
@squid : any news for my mkv problem in the new version ?

squid_80
29th July 2006, 10:38
Is your problem mainly that the mkv output from xvid_encraw is unplayable in vlc? What if you use mkvmerge to remux it to a new file?

MatMaul
29th July 2006, 11:09
the mkv output is playable in vlc but with big and horrible macroblocks. Same problem if I remux the mkv in a new mkv with mkvmerge.

If I do m4v->mp4->mkv, I don't have this problem but an other problem, but I think this new problem is related to mkvmerge (I have report the problem in the mkvtoolnix thread).

squid_80
29th July 2006, 12:20
Are you using GMC on your clips?

MatMaul
29th July 2006, 13:51
no.
I use the preset 58hq :
pass1 : xvid_encraw.exe -i video.avs -type 2 -pass1 xvid.stats -max_key_interval 250 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 1 -qtype 1 -qmatrix Didees-SixOfNine.cqm -nopacked -quality 5 -nochromame -turbo -zones 0,q,3,O
pass2 : xvid_encraw.exe -i video.avs -type 2 -mkv video.mkv -pass2 xvid.stats -bitrate 2500 -max_key_interval 250 -max_bframes 2 -bquant_ratio 162 -bquant_offset 0 -vhqmode 4 -bvhq -qpel -qtype 1 -qmatrix Didees-SixOfNine.cqm -nopacked -imin 2 -imax 4 -bmin 2 -bmax 5 -pmin 2 -pmax 5 -quality 6 -chigh 10 -clow 3 -ostrength 0 -zones 0,w,1,O

squid_80
29th July 2006, 14:18
VLC seems to be buggy in the way it handles native mpeg4 in mkv. Any advanced options such as qpel, gmc, mpeg quantization etc. seem to produce artifacts. I've checked by converting other avi files (not created with xvid_encraw) to mkv with mkvmerge using --engage native_mpeg4 and they show the same errors when played in VLC.

MatMaul
29th July 2006, 14:59
But do you know why it works good if I do m4v->mp4->mkv ?
I have report this problem in the videolan forum and the videolan dev list with a sample but no answers.

squid_80
29th July 2006, 16:06
When you convert from mp4 to mkv do you use --engage native_mpeg4?

MatMaul
29th July 2006, 23:22
When you convert from mp4 to mkv do you use --engage native_mpeg4?

No I don't use --engage native_mpeg4 but mp4 uses raw mpeg4 data, without any hacks, so I think when I remux a mp4 to mkv, it uses native mpeg4 data.
I test --engage native_mpeg4 tomorrow to be sure.

squid_80
30th July 2006, 05:10
When I tested mp4->mkv using mkvmerge, it gave me a vfw mkv file (with the frames in the wrong order around I frames - I believe bond reported this long ago). When I used --engage native_mpeg4, it gave me a native mkv file but there was something strange; the VOL information was appended to each P frame preceeding an I frame. In a native mpeg4 matroska file that information should only occur once in the CodecPrivate section. If I had to guess, I would say VLC isn't reading this at all and is relying on the information being present in the stream which is the wrong way to do it.

MatMaul
30th July 2006, 14:53
OK after test you are right, mkvmerge use vfw mode if I do m4v->mp4->mkv, so the problem is vlc with native mpeg4 stream.

Can you post this technical details in this thread (http://forum.videolan.org/viewtopic.php?t=21189) on videolan forum please ?

EDIT : an other question, how do you compile xvid_encraw with mkv support ?

I have all the dependencies but I don't know how compile a c file with c++ file included in it.

kypec
31st July 2006, 10:11
...and dynamic linking with xvidcore.dll.

Sorry, but what exactly does it mean to me as a plain user of xvid_encraw?
Do I still need to install some XviD build (like 1.2) separately?
@squid_80
BTW, can you confirm that this download link of dunstan's (http://okejl.dk/dunstan/xvid_encraw.zip) contains the most up-to-date release of your builds?
I'm asking this because your FTP server is not working again :mad:

P.S. thanks for your great effort put into this CLI of XviD
I just like to write my scripts/batches once and use them million times:cool:

squid_80
31st July 2006, 10:16
EDIT : an other question, how do you compile xvid_encraw with mkv support ?

I have all the dependencies but I don't know how compile a c file with c++ file included in it.
Compile it as a c++ file. :) You'll also need to link it with libmatroska and libebml.

Sorry, but what exactly does it mean to me as a plain user of xvid_encraw?
Do I still need to install some XviD build (like 1.2) separately?Yes, it just means it should work properly with any version of xvidcore.dll. You still need it installed from somewhere.
BTW, can you confirm that this download link of dunstan's contains the most up-to-date release of your builds?
Yes.

MatMaul
31st July 2006, 10:53
thanks !

bond
6th August 2006, 14:33
MatMaul: native asp support in videolan is buggy

vlc is not able to play correct native asp files created by xvidencraw or haalis muxer (yeah, xvidencraw creates correct native asp files!!!).
it also doesnt play native asp files created by mkvmerge (via .mp4 source (avi/raw source doesnt work))

in all cases vlc shows artefacts. its a known problem i have told robux4 a long time ago already, but which was never fixed

mod
22nd August 2006, 11:30
I'm trying to make a change but I can't find (or maybe I'm blind ok..) the source files needed by matroska.h, could anyone please give me a link to an updated page with all source files?
Thanks!

squid_80
22nd August 2006, 12:30
Get libmatroska and libebml from matroska.org.

mod
22nd August 2006, 12:41
Thanks A LOT :)

squid_80
25th August 2006, 08:38
MatMaul: native asp support in videolan is buggy

vlc is not able to play correct native asp files created by xvidencraw or haalis muxer (yeah, xvidencraw creates correct native asp files!!!).
it also doesnt play native asp files created by mkvmerge (via .mp4 source (avi/raw source doesnt work))

in all cases vlc shows artefacts. its a known problem i have told robux4 a long time ago already, but which was never fixed
Despite certain people in the videolan forums declaring asp-in-mkv "proprietary" and "non-standard", VLC has been patched and when I downloaded the latest nightly snapshot it played my test files without problems. So much for having to petition all the major players and codec vendors blah blah blah...

bond
25th August 2006, 16:33
great :)

Brother Darrell
26th August 2006, 10:15
How about a quick post on proper commandline syntax using Xvid_encraw? So far, the only thing I have found are snippets I have copied from Bond or Squid or anyone else who seemed to be getting ANY result different from mine.
I spent a couple of hrs trying to determine why my command line would only do a 1 pass 4quant encode with b-frames. (No b frames in the stats file). As it turns out, it's because I was using "-type 2" before the avs file instead of after it. So I think a small guide on the proper syntax for the command line would be great.

Edit: Duh!!...If I had only read past 2 more threads, I would have found it...You would have thought I could have narrowed it down a great deal using the search funtion for the forums but nooo, As much as I love this site, I think the search function for the forums Is WAY too limited..(Speaking of syntax).

MatMaul
26th August 2006, 23:09
Despite certain people in the videolan forums declaring asp-in-mkv "proprietary" and "non-standard", VLC has been patched and when I downloaded the latest nightly snapshot it played my test files without problems. So much for having to petition all the major players and codec vendors blah blah blah...

yes the problem of blocky images is solved, but I actually can't seek in the file, and the length of the video isn't recognized.

squid_80
27th August 2006, 02:34
As it turns out, it's because I was using "-type 2" before the avs file instead of after it.
Can you elaborate a bit? Like what was the failing command line and what you ended up using to make it work? There is a *very minor* bug with -type but I don't know how it would cause a lack of b frames.
yes the problem of blocky images is solved, but I actually can't seek in the file, and the length of the video isn't recognized.
Remux the file. I never fixed encraw to write cues correctly which probably explains the lack of seeking, I don't know why the duration is missing as well.

MatMaul
27th August 2006, 11:15
ok thanks, no problem after remux.

bond
27th August 2006, 15:55
are cues mandatory for seeking?

squid_80
27th August 2006, 17:46
I don't think so, they just help.

bond
27th August 2006, 17:51
I don't think so, they just help.so vlc is not yet perfect?

Brother Darrell
28th August 2006, 03:55
Can you elaborate a bit? Like what was the failing command line and what you ended up using to make it work? There is a *very minor* bug with -type but I don't know how it would cause a lack of b frames.

Sorry. I've tried to reproduce the problem. Now I can't. Damn thing won't break now that I want it to. I can tell you I think it was an earlier version of encraw I was using.(From February I think). Once I got the syntax correct & installed a newer version, I was good to go. Sorry man.. I will continue to try & break it though. :D

Brother Darrell
29th August 2006, 06:59
Uh oh. My file came out great but with absolutely no header info. I figured out how to use mencoder for the fourcc and bitrate issue (actually, mencoder took care of the bitrate issue). But it says my resolution is 0x0. How do I tell it W/H of the video? I thought encraw did it but obviously not. this is my command line:

mencoder.exe "movie1.m4v" -ovc copy -mc 0 -noskip -ofps 23.976 -ffourcc XVID -o "test.avi"

I have tried aspect=16/9 I have tried -ow 720 -oh 432. I have also tried verbal abuse & bribery. What's the key?

squid_80
29th August 2006, 07:05
Are you trying to use mencoder to mux an elementary stream into avi? Why not just output .avi directly from encraw?

Brother Darrell
29th August 2006, 09:14
Tried that as well. I have played with it enough , so I think I have down the syntax. MediaInfo sees everything I have added (info-wise) except the width & hieght. Avi is seen as 0x0 as well. I can't imagine this being a bug. No one else is complaining. So it has got to be my command-line. Recoding with the following commandline using encraw:

"xvid_encraw.exe " -i "D:\Blah.avs" -quality 6 -vhqmode 1 -imin 2 -imax 31 -pmin 2 -pmax 5 -overhead 650 -framerate 23.976 -pass2 "D:\blah.pass" -qmatrix "D:\hvc matrix.txt" -w 720 -h 432 -par 5 -o "D:\movie1.m4v" -size 2073344 -progress 5

squid_80
29th August 2006, 09:25
So if you use -avi "d:\movie1.avi" instead of -o "d:\movie1.m4v", the avi file has dimensions of 0x0?

mod
29th August 2006, 09:31
I think the line must be:

"xvid_encraw.exe " -i "D:\Blah.avs" -type 2 -quality 6 -vhqmode 1 -imin 2 -imax 31 -pmin 2 -pmax 5 -overhead 650 -framerate 23.976 -pass2 "D:\blah.pass" -qmatrix "D:\hvc matrix.txt" -w 720 -h 432 -par 5 -o "D:\movie1.m4v" -size 2073344 -progress 5[/QUOTE]

squid_80
29th August 2006, 10:01
-type 2 is implied if the input file has an .avs or .avi extension. Width and height should be retrieved automatically, but I think if you manually set them smaller than the actual values the output will be cropped (don't set them bigger, I can't remember what will happen but it certainly won't enlarge the image to fit).

mod
29th August 2006, 10:19
I prefer to set -type 2 ("I sleep better" ^^).
Hmm.. In my experience it has never failed getting the correct dimensions of the video, so I don't see any reason to use it, unless, as you just wrote, to perform a crop (if this is what happens btw). Maybe it's a bit slower (dunno) but I wouldn't mind of that.

squid_80
29th August 2006, 10:43
Mainly -w and -h are for setting width and height when the input is raw yv12 (or stdin).

mod
29th August 2006, 10:46
Ok, didn't know (I never used it with that input). Thanks for the info.

Brother Darrell
29th August 2006, 15:05
AS far as an AVI file, that is correct, at least on my (very short) test clip. I am trying again (m4v) with the command line above. It may very well be I'm using the wrong switches. So I'm looking as always for proper commandline syntax. Is there anything else that would build the header for me, other than mencoder?
And isn't the output I'm producing a raw file? I thought it was as my very 1st attempt gave me NOTHING for header information(mediainfo).

Edit: Well, I got a file which so far seems to be correct in all aspects. MediaInfo sees the dimensions & par correctly. I haven't run it thru mencoder yet but I suspect it will see the info as well. I sometimes tend to get impatient & stop the encode simply to view the results. This may be my issue all along. Mencoder & MediaInfo won't see it for a very good reason. I broke the file.
(Plausible..yes?)

squid_80
30th August 2006, 00:39
If you forcibly close encraw before it is finished then the avi file will be broken.

henryho_hk
3rd September 2006, 06:15
The xvid_encraw compile at http://celticdruid.no-ip.com/xvid/ seems to be the most recent (Jul 06) but the result are always changed to 25fps.