is there an updated version of rawsource() that i don't know about ?
RawSource("video.y4m", width=720, height=480, pixel_type="yv12")
RawSource("video.y4m", width=720, height=480, pixel_type="i420")
but the picture comes out with wrong uv (swapuv does not it) and tares, for lack of proper term for this.
+ Reply to Thread
Results 1 to 30 of 39
RawSource("example.y4m", width=384, height=288, pixel_type="yv12")
Since that sample has the header data all it needs is:
Can you provide a sample?
Last edited by jagabo; 23rd Sep 2013 at 22:09.
in the begining, i used .yuv to encode with x265. could also preview in avisynth/virtualdub. however, i went to .y4m so i wouldn't have to enter w/h/fps to the encoder. been using that for a while now, and videos encode properly. now i need to review some of the files quicky because i am naming them shorter, like video1.y4m, video2.y4m, ... well, that's how i work at this point.
Another possibility --- that's just another symptom/indicator of how much vhelp's XP setup is screwed.
just rethinking about it some more.. there are two ways to convert videos to .y4m using avs2yuv and ffmpeg. i'm pretty sure i used ffmpeg in all these videos.
edit: correction made: avs2yuv
solved... short answer, change the param in ffmpeg..read on, for details..
these are the methods i've used to convert avs videos to .y4m for x265 encoding:
ffmpeg -i video.avs -an -pix_fmt yuv420p -f yuv4mpegpipe -y video3.y4m
avs2yuv c:\dgavc.avs g:\video3.y4m
both above methods cause the same problem in original post.
however, when i change to this (just learned this via help)
avs2yuv c:\dgavc.avs -raw g:\video3.y4m
then the video decodes correctly in virtualdub, using the same script:
x = "g:\video3.y4m"
RawSource(x, width=720, height=480, pixel_type="yv12")
there's no -raw param in ffmpeg, perhaps someone knows equiv.
edit: i found the solution to the ffmpeg conversion to .y4m and correct playback via avisynth/virtualdub:
(replace -f yuv4mpegpipe to rawvideo)
ffmpeg -i video.avs -an -pix_fmt yuv420p -f rawvideo -y video3.y4m
result: plays successfully in virtualdub using the above avs script.
For the record: on my XP machine, RawSource() on a y4m file doesn't require the workarounds you used.
Specifying the parameters width, height and pixel type makes no difference, since the plugin can read this whole info from the Y4M headers.
When you tell avs2yuv or ffmpeg to generate a raw output, then the resulting file has no headers, regardless of the y4m file extension.
So it seems that the "fishy factor" is not letting your copy of Rawsource.dll work as it should.
The first four lines is the Y4M header. The rawvideo command doesn't include them. Also each frame in the try Y4M video has "FRAME(0x0a)" at the start of each frame:
In short, the first command produces a true Y4M file, the second command produces a raw video file. And RawSource() doesn't understand the Y4M header that ffmpeg produced. ffmpeg's header includes more information than the Y4M sample I was working with:
Last edited by jagabo; 24th Sep 2013 at 07:36.
@ jagabo, i d/l'ed the hex editor, but it didn't have a cutter or trim? that you mentioned.
so, of course, you guys are correct. the method i used defeats the .y4m purpose.
ok. so today i learned that the .y4m file would not encode in x265 because it was missing the header info (res, fps, etc) and stop the encode.
it turns out that i need to resolve the original problem. so, getting back to the original problem. i thought that it might be a decoder problem, somehow. so i am wondering how is avisynth decoding internally or is it calling a decoder to process the .y4m data. maybe if calling a decoder, i can change it somehow.
AviSynth is calling rawsource.dll to do the decoding. Unfortunately, rawsource.dll can't handle the longer headers that ffmpeg creates in Y4M files. I looked at the source code and it appears that the first "FRAME" must be within the first 64 bytes of the file. It should be easy to change that but I don't know if I have the tools to build it. I'll take a closer look tomorrow.
great. or else.. is there anything i can do to the .y4m files. oh, but avs2yuv also has the same probem. did you check that one too ?
and, by first "frame", do you mean, just that frame, or all frames ?
ps: i wonder how/why this got overlooked on doom9 as a posible fix being that it is still being maintained.
OTOH, when I create a y4m file through the following command-line:
ffmpeg -i video.avs -an -pix_fmt yuv420p -f yuv4mpegpipe -y video3.y4m
Avisynth open failure:
YUV4MPEG2 header error.
Last edited by El Heggunte; 24th Sep 2013 at 23:59. Reason: .....
i just double-checked the ffmpeg / avs2yuv methods in x265. both encode perfectly fine. so it must have something to do with the way y4m files are processed by decoders. x265 decodes it correctly. avisynth plugin, rawsource, does not.
also, if you feed each y4m version into avs script -> vdub, each frame is off by a few pixels. the ffmpeg version has 24 additional bytes to the file than avs2yuv's y4m file.
i will try a few different ffmpeg versions to see if there are any differences in each.
Just as an apparently-nonsensical idea: 1) do you have ReClock installed on your XP rig?
2) if the answer is "no", then please give a try to it.
3) you don't have to use it, just install and configure. Because it MAY compensate what is broken in your DirectX setup Worked for me before I moved from a b0rked XP Home to a clean XP Pro, so it's not impossible the remedy works for you too ^.^;;
Last edited by El Heggunte; 25th Sep 2013 at 02:07. Reason: edit :-)
will give a look at tomorrow.
do you know how to get mencoder to output y4m ?
i want to try and see if it will work, just curious. i tried googling, but man, i get very little hits if any. and you have read so much before you realize its not related. very tiring. anyway. i found this, but i can't get it to work.
mplayer -vo yuv4mpeg:file="g:\video5mplayer.y4m" -i "c:\DGAvc.avs"
mencoder -vo yuv4mpeg:file="g:\video5mplayer.y4m" -i "c:\DGAvc.avs"
ps: i'm beat. tomorrow's another day.
Last edited by jagabo; 25th Sep 2013 at 08:02.
Oh, I should mention, that old hex editor can't work with files over 4 GB.
did not work. note that both files were slighly different from each files start position to FRAME position. the video previews in the same way in post 1.
i would post pics but it is just too much of a hassle to do..let alone on a netbook.
Can you upload a sample with the first several frames? With the hex editor mark a section from the start to a few MB into the file, then select Edit -> Copy To File. Alternatively, you can start a few MB into the file, then use CTRL+SHIFT+END to mark from there to the end of the file, then press DELETE, then File -> Save As a new file.
Last edited by jagabo; 25th Sep 2013 at 19:02.
this site is no longer accepting my files. keeps rejecting them. i've had trouble before U/L'ing files recently. something must have changed since. and DSL is too slow for me to keep posting test uploads. sorry.
i will try and work on the issue with y4m decoding, later.