is there an updated version of rawsource() that i don't know about ?
i used:
RawSource("video.y4m", width=720, height=480, pixel_type="yv12")
or
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
-
Last edited by vhelp; 24th Sep 2013 at 22:50.
-
This worked:
Code:RawSource("example.y4m", width=384, height=288, pixel_type="yv12")
Since that sample has the header data all it needs is:
Code:RawSource("example.y4m")
Can you provide a sample?Last edited by jagabo; 23rd Sep 2013 at 21: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.
-
i would post a sample, but over DSL, still to slow, and the smallest file i have is 61mb.
-
Another possibility --- that's just another symptom/indicator of how much vhelp's XP setup is screwed.
-
as long as i can watch tv and code on computer at same time, i'm happy
-
-
Someone mentions a file cutter here every now and then. I use a hex editor. An old version of this:
http://www.hhdsoftware.com/free-hex-editor -
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"
LoadPlugin("c:\plugins\rawsource.dll")
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.Last edited by vhelp; 23rd Sep 2013 at 21:52.
-
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.
-
So the difference is the first command produces a raw YV12 video file with a Y4M header, the second command produces simply a raw video file. You can clearly see the Y4M header in a hex editor:
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 06: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.
http://forum.doom9.org/showthread.php?t=39798&page=8Last edited by vhelp; 24th Sep 2013 at 22:48.
-
I doubt avs2yuv "has the same problem". Over here, even an outdated build (the last one written by akupenguin) produces y4m files that are readily accepted by Rawsource.dll.
OTOH, when I create a y4m file through the following command-line:
Code: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 22: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 setupWorked 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 01: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"
none work.
ps: i'm beat. tomorrow's another day. -
Last edited by jagabo; 25th Sep 2013 at 07:02.
-
just wanted to say, using my netbook, xp home, clean, i loaded up both y4m versions and they failed. same issue. so it is not on account of my current state of my desktop pc with xp.
-
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 18:02.
-
i will upload two videos, re- avisynth-ffmpeg-y4m and avisynth-avs2yuv-y4m, 10 frames, shortly.
-
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.
Similar Threads
-
convert raw video .y4m to mpg video with certain GOP
By abeer in forum Video ConversionReplies: 1Last Post: 26th Nov 2012, 10:23 -
Ripping DVD into Y4M
By OpasanNekiLik in forum DVD RippingReplies: 0Last Post: 2nd Apr 2011, 12:31 -
encoding y4m with X264
By m4Rio in forum Newbie / General discussionsReplies: 6Last Post: 11th Aug 2010, 12:08 -
Help in CAVLC decoding
By krao in forum ProgrammingReplies: 0Last Post: 15th Jul 2010, 16:55 -
subtitles gone after decoding
By Meredy in forum SubtitleReplies: 1Last Post: 7th Jul 2009, 07:52