View Full Version : YUV-Bitmap Import filter?
hanfrunz
6th December 2002, 00:57
Hello,
in our company we have a Abekas 8150 production switcher. It has a framestore option so you can save framegrabs to a .yuv file. The format of this file is very simple: (i can email a sample if someone wants it)
720x576 Pixel (PAL):
Y(8bit), U(8bit), Y(8bit),V(8bit)... and so on. As you can see its 4:2:2.
Now my question: is there a way to import these files (lets say i have 250 grabs = 10sec) into avisynth and serve it directly to tmpenc without any colorspace conversions and create a mpeg2 file?
There is also the possibility to save .y10 files witch are 10bit instead of 8! But i think mpeg2 is always 8bit (am i right?)
thanks
hans runz
WarpEnterprises
6th December 2002, 14:35
did you try ImageSequence.dll ?
It's the only plugin around to import image files.
Is there no way to change the output format?
(we have a similar task)
scmccarthy
6th December 2002, 16:26
The YUYV sequence is what the fourcc code YUY2 refers to. AviSynth can read that data if you have the right import filter.
Stephen
hanfrunz
7th December 2002, 00:42
Hello,
i tried ImageSequence.dll, but it is not working. :(
Can anybody code an import filter for me, that imports raw yuv2 files?
Hans Runz
scmccarthy
7th December 2002, 05:40
The fourcc code us YUY2.
If you attach a frame or if you can give more specific information about this raw data and how it is produced and someone might look at is out of curiousity, anonymously.
It is at least interesting as a question.
Stephen
hanfrunz
7th December 2002, 14:39
Hello,
@scmccarthy: i gave information about this format in my first question.
a PAL frame (720x576):
row1: Y001 U001 Y002 V001 Y003 U002 Y004 V002 ... Y719 U360 Y720 V360
row2: Y721 U361 Y722 V361 ...
etc.
it is produced with an Abekas 8150 production switcher (http://accom.com/products/abekas/8150/8150-frameset.html)
or with a photoshop in-/export plugin: ftp://ftp.accom.com/abekas/software/8150/win95-nt_plugin/psnt95.zip
Hans Runz
Marc FD
7th December 2002, 19:36
@ hanfrnz
it's very easy tocode. you just need to read YUY2 from yourfile and memcpy to new frames.
BTW, AFAIK, TMPEGEnc only works with RGB24 input. so you'll need a convertion.
if you attach a file with 2-3 320x240 frames i can code that in speed.
<EDIT>
not a good idea : i would't be able upload it :-/
so i've just 2 question :
- how are consecutive frames stored ? (behind eachother i thing)
- is there any header, or you need to enter size manualy.
hanfrunz
7th December 2002, 19:53
@ MarkFD
answer 1: each frame is stored in a seperate file! like t001.yuv, t002.yuv ...
answer 2: there is no header in these .yuv files and the resolution is always 720x576 (PAL) and 720x480 (NTSC)
is there a mpeg2 coder which uses yuv2 input? I always thought an mpeg2 file is yuv (4:2:0) or is it rgb???
<edit>
if you give me your email-adress i can send you a sample image. i tried to attach it to this reply, but is doesn work...
hans runz
Marc FD
7th December 2002, 20:02
>answer 1: each frame is stored in a seperate file! like t001.yuv,
>t002.yuv ...
>answer 2: there is no header in these .yuv files and the resolution is
>always 720x576 (PAL) and 720x480 (NTSC)
the source filter will need 4 args (path,maxframes,width,height) and will output YUY2. that's okay ?
>is there a mpeg2 coder which uses yuv2 input? I always thought an mpeg2
>file is yuv (4:2:0) or is it rgb???
MPEG is YV12 (4:2:0)
YV12 support is recent in Avisynth (2.5 alpha), before we needed to upsample YV12 to YUY2.
Marc FD
7th December 2002, 20:18
okay it's almost finished. you want it for Avisynth 2.07 or 2.5 alpha ? ^_^
hanfrunz
7th December 2002, 20:23
@ MarcFD
>the source filter will need 4 args (path,maxframes,width,height) and will output YUY2. that's okay ?
yep! that is exactly what i need! :-)
YV12 is 8bit/Y, 8bit/U and 8bit/V right?
Hans Runz
hanfrunz
7th December 2002, 20:37
>okay it's almost finished. you want it for Avisynth 2.07 or 2.5 alpha ? ^_^
hey cool, thats fast! i think 2.5alpha would be nice :-)
hans runz
scmccarthy
7th December 2002, 20:46
@hunfrunz
It wouldn't hurt to get the terminology right. Notice we are saying YUY2, not YUV2. YUV is the generic term we use for any color space that uses Y, U, and V samples. YUY2 uses 8-bit samples YUYVYUVY... I remember it by saying they replaced the V with a 2 in the name.
If your files use 10-bit samples, they can be truncated to 8-bit by dropping the two least significant bits.
@MarkFD
I posted a thread today, asking how to write a filter that does not take a clip as the first argument. GetGenericFilter needs a clip as an argument and once I remove it, I don't know what to replace it with.
The filter we are talking about here would make a good simple example of how that can be done. I can't write a filter like this yet, could you show me how?
Stephen
Marc FD
7th December 2002, 21:10
okay i've finished. Avsiytnh 2.5 is cool, because i don't want to switch back ^^.
rawYUY2load/rawYUY2save (to test the loader ^^)
i've some packaging to do.
it read path???.yuy2 files where path is user-defined and ??? is the frame number (001-002..) it's okay for you ??
@scmccarthy
just instansiate IClip, create a new VideoInfo, and fetch the functions.
hanfrunz
7th December 2002, 21:18
@Mark FD:
thank you very much!
>frame number (001-002..) it's okay for you ??
i think five or six digits would be better -> 000001-000002...
can you send it to me for testing ?
hanfrunz
Marc FD
7th December 2002, 21:19
OUPS !! 6 digits ??
shit i was going to release.
okay i'll do it.
Marc FD
7th December 2002, 21:22
6 digits.. done.
(attached "rawYUY2.zip")
hanfrunz
7th December 2002, 21:25
thanks again,
now i see the attachment... :-)
hans runz
hanfrunz
7th December 2002, 23:23
uuups i made a B-I-G mistake... :scared:
it's not YUY2, but UYVY!
i tested the filter with a byte-swapped file i created with a simple basic programm and then everything is fine!!
@MakrFD:
it would be very nice if you could add a RawUYVYload and RawUYVYsave (with file-extension .YUV) then it would be another perfect avisynthfilter!!!!
hans *very sorry* runz
Marc FD
7th December 2002, 23:58
(attached "raw422 beta 2.zip")
hanfrunz
8th December 2002, 16:46
Thanks a lot MarcFD, you are my hero!
will you release the source code, so everybody can learn how it´s done?
hans runz
Marc FD
8th December 2002, 17:06
it's ugly, sbasic (~150 lines) and i don't have time to release it, but if someone really want it, i'm an opensource coder after all ^__^
WarpEnterprises
8th December 2002, 22:43
Please, what's "sbasic" ?
scmccarthy
8th December 2002, 23:04
Mark FD -
I am definitely interested in seeing the code. Did you write it in a programming language other that C++? I finally figured out how to write a YUV version of colorbars(). Dividee told me how to handle the audio, so now it works. I am using the invert filter as a pattern. I need to compare that with simple filters that work entirely differently.
Stephen
Marc FD
9th December 2002, 13:06
>Please, what's "sbasic" ?
i wrote first : "simple", then i delete it simpl simp sim so s and i wrote basic => sbasic . it's a typo ^^
@stephen
i'll pack it a day with the sources if i write some new stuff.
scmccarthy
9th December 2002, 16:19
No, no, sbasic is really a neat new programming language!;)
If you can really write a filter in basic instead of cpp I'd like to see how that is done.
Stephen
Marc FD
9th December 2002, 16:48
quoting myself :
>i wrote first : "simple"
i didn't mean basic as a langage. "basic instinct" is not a film about computers ;)
hanfrunz
31st January 2003, 00:38
Hello MarcFD,
the new 2.5 beta is out and your fantastic filter is not running anymore :
"Plugin raw422.dll is not an AviSynth 2.5 plugin"
would be cool, if you had time to fix it.
Thanks again,
hanfrunz
WarpEnterprises
31st January 2003, 23:45
MarcFD has abandoned development and this filter has no source code.
Stick to 2.0 for this application (you can safely use two versions)
WarpEnterprises
15th February 2004, 22:17
I made a new version for importing YUV-files (WITH source code):
http://www.avisynth.org/warpenterprises/
RawSource(filename, width, height, pixeltype)
e.g.
RawSource("d:\src6_ref__625.yuv",720,576,"UYVY")
Change the framerate with AssumeFPS(30) if it is not 25fps.
"pixeltype" isn't the internal AviSynth-format, but the format in the YUV-file. This will be mapped correctly, without any resampling.
Supported types:
RGB, RGBA, BGR, BGRA, YUYV, UYVY, YVYU, VYUY
Remember, this plugin reads video files which contain many frames.
It works for reading ONE frame, but not for file sequences (they must be loaded separately).
sh0dan
16th February 2004, 09:26
Actually I think Richards ImageReader/ImageWriter supports YUV images by now (in ebmp mode).
Wilbert
16th February 2004, 10:30
@WarpEnterprises,
1) what do you use to make such a yuv clip?
2) No NTSC support?
ac-chan123
16th February 2004, 14:59
I have request a filter for using .yuv file in avisynth.
Sources of .yuv:
-VQEG (http://www.VQEG.org)
-xiph (http://medi.xiph.org)
-on the homepage of the most codec standardization group like mpeg and avc
AC-Chan(Robert Vincenz)
Wilbert
16th February 2004, 21:39
Sorry, I misread the docs. There is NTSC support.
I have one small request thought :) Could you add I420 and YV12 support?
The only free avi2yuv tool I could find:
http://www.ee.surrey.ac.uk/Personal/S.Worrall/dloads/
converts uncompressed RGB stuff (= tried XviD encoding, didn't work) to I420.
WarpEnterprises
16th February 2004, 23:04
I hate YV12 :-)
ac-chan123, your problems with the xiph videos come from that format.
It is a little more typing to add this and I have to download some frames first, but I will give it a try (which gives the answer to Wilbert, too).
WarpEnterprises
17th February 2004, 01:13
OK, get the new version with YV12 and I420 support.
@ac-chan: try
RawSource("d:\blue_sky.yuv",1920,1080,"YV12")
ac-chan123
17th February 2004, 03:33
@WarpEnterprises: i try it and it work realy good. but if i (Source) playback "YV12" yuv file per avs in VDMod v1.5.10.1, there change the color. when i go one frame after an other, the color is ok.
Richard Berg
17th February 2004, 06:26
Originally posted by sh0dan
Actually I think Richards ImageReader/ImageWriter supports YUV images by now (in ebmp mode).
This is true. Right now it uses a small custom RIFF header to set the image parameters, but these could be specified as filter arguments (to the Reader) if there was demand.
WarpEnterprises
17th February 2004, 23:04
@Richard:
- Is that ebmp == the custom RIFFed filed?
- ImageWriter: would it be possible to APPEND all written images to ONE file (without header), with this it would be possible to generate those YUV files, maybe useful for testing purposes.
It is clear that we (ImageReader/RawSource) have some overlapping functionality but I don't see how to combine it nicely.
Wilbert
21st February 2004, 01:30
I added YV12 support for you! Not bad for someone who can't program :)
I failed to add I420 (which is what I really want). I tried to add the code of SwapUV, but I couldn't get that to work. But there might be a simplier way.
Could you have a look at I420 support?
I420 clip (640x480, 25 fps):
http://www.geocities.com/wilbertdijkhof/raw.yuv
source+dll:
http://www.geocities.com/wilbertdijkhof/RawSource.zip
Note that if you open the clip as YV12, you will see that the output is correct except that the U and V channels are swapped. Thus YV12 input is correct since YV12 = I420 with swapped U and V.
sh0dan
21st February 2004, 13:24
Made a few changes to YV12, and added simpler I420 support.
Now tested (and working now)
http://cultact-server.novi.dk/kpo/avisynth/rawsource.zip
Wilbert
21st February 2004, 21:19
Forgot to add GetWritePointers ... Thanks :)
WarpEnterprises
21st February 2004, 23:06
really don't want to stop you from programming but my version (2004-02-17) already had YV12/I420 :confused:
However, it's a nice example to learn planar.
Wilbert
22nd February 2004, 21:43
Why didn't you say so ? I can't read your mind :)
1) If I put this plugin into the plugindir, WMP6.4 says 'Ran out of memory' when opening an arbitrary script. Do you have any idea why?
2) It's perhaps a nice plugin for the core?
3) Small programming questions:
What does the following line:
ret = _lseeki64(h_rawfile, bytes_per_line * vi.height * n , SEEK_SET);
Is this one necessary:
memset(rawbuf, 0, maxwidth * 4);
WarpEnterprises
22nd February 2004, 22:48
I did say (a post in this thread)
Which version exactly did you feed WMP?
_lseeki64 is a file-seek working for files>4GB. You need to seek if you have non-linear access (there are many file access layers - FILE, ifstream,.. - and I'm not sure which work >4GB, this does)
memset sets the buffer to 0 in case there is some read error you see it clearly and not some leftover from past frames.
Wilbert
22nd February 2004, 23:08
Which version exactly did you feed WMP?
Yours, and the one of Sh0dan.
WarpEnterprises
22nd February 2004, 23:28
works here. WMP6.4, W2K.
Does it show any frames or crash before displaying something?
Does VD work?
Wilbert
22nd February 2004, 23:54
Let me first say that it works if I keep it outside the plugindir.
If I put it in the plugindir, and I open an arbitrary script in WMP6.4 or vdub it doesn't show any frames. It just says: 'ran out of memory (WMP6.4)' and in vdubmod 1.4.13 / vdub:
Avisynth open failure:
AviSynth: script open failed!
If I just open vdubmod 1.5.10.1 itself, I get this message:
http://www.geocities.com/wilbertdijkhof/raw.jpg
W2K, Athlon XP
billou2k
21st May 2004, 15:10
Hi,
I've got a 4 minutes 422 (UYVY) raw PAL sequence in separate files (4500 files for a total of 3.47GB) (one file without headers for each frame).
I first tried using imagereader but I didnt manage to open the clip and I'm not sure I can as there is no way to specify the dimensions.
Then I concatenated all the files to try to open the video with "rawsource" plugin (as I think it only takes one file with all frames in it) It looked like it worked ok until frame 2589... which actually corresponds to the frame where the file reaches a size of 2GB...
Frome frame 2590 I ve got randomly either green frames or frames that have been displayed before and going back several times to the same frames display different things...
So I don't know where the problem occured: during the concatenation from my 4500 files into 1 single file or in rawsource...
Ideally I'd prefer to use a plugin that would access the 4500 files directly as I wouldnt need to play with an exrta 4G files...
Anybody got an idea to work around that problem?
Thanks a lot!
WarpEnterprises
24th May 2004, 12:54
I think I forgot some int64-casts in RawSource, so although it should work it doesn't above 2GB. I can fix it this week.
billou2k
24th May 2004, 13:28
Really? That would be great!
Thanks a lot for your time!
WarpEnterprises
26th May 2004, 08:58
please try
http://www.avisynth.org/warpenterprises/files/rawsource_25_dll_20040525.zip
hope it works now.
billou2k
26th May 2004, 13:29
Indeed it works perfecly well! great job!
Thanks a lot for fixing it so quickly!
billou2k
18th June 2004, 14:40
Warp: Sorry to bother you again but I discovered some problems using rawsource.
I'm using avisynth also to do some overlay on the raw YUV sequences I'm reading with "rawsource".
Unfortunately it's crashing after 20 seconds of processing, with the PC getting very very slow (dual 3GHz 2GB of ram).
After some more testing I realised that MPC or VDUB playing (or saving to avi) the avs file containing only rawsource use more and more memory during the playback: it goes up to 1.4 GB after 24 seconds of PAL raw YV12...
Playing the same video wrapped in an avi file yv12 (rather than the raw yv12 file using rawsource) just uses 20MB or so at the maximum.
So It looks like the rawsource plugin keeps in memory all the pictures it has decoded rather than just keeping the current one. Does it make sense?
Do you think that this is something that could be solved, so that I could run my main script?
Thanks a lot for your plugin.
Cheers
WarpEnterprises
21st June 2004, 11:28
did you try to NOT put it in the plugin dir as Wilbert suggested?
do you use the latest AviSynth version?
I can't find any obvious memory allocation error - the plugin isn't allocating memory at all.
billou2k
21st June 2004, 11:48
Actually I never put rawsource in the plugin dir, I'm just loading it from the current directory.
I'm using the latest avisynth as well (v2.55, 17 june 2004)
Ok... I would have thought the problem might come from rawsource but maybe it comes from avisynth then....
Can anybody else observe the memory used by Avisynth/Vdub/MPC increase to non sensible heights ? (1.4 GB after 24 seconds of PAL video)
I dont know what to do now:D I can try on another computer though and check if it does the same thing or not...
WarpEnterprises
22nd June 2004, 08:13
I checked again. I see this:
AviSynth eats up RAM according to its cache strategy, e.g. up to 100MB on my 256MB system.
Maybe there is an error how it measures free ram.
@billou2k:
1) which OS?
2) please try SetMemoryMax(100) and look if it obeys the 100MB barrier.
billou2k
22nd June 2004, 19:22
Thanks for your reply,
I'm running XP but I tried on a 2K system with 1GB of ram and it eats most of the remaining memory also (600MB or so)
I havent had much time yet, but after some quick tests it looks like adding the SetMemoryMax(100) helps a bit but doesnt respect the 100MB barrier although it is much better than before (600MB instead of 1400MB for 24 seconds of raw PAL YV12)
But that strange behaviour of eating more and more memory as the video plays seems strange to me...
Anyway thanks for the help!
Wilbert
5th April 2005, 21:58
@WarpEnterprises,
Is it possible to add YUV4MPEG support to your plugin? As I understand it YUV4MPEG is just "header + raw planar YUV".
WarpEnterprises
6th April 2005, 14:59
Can you point me to a source test clip and/or discussions?
If it's possible to parse or recognise the header it should be not that hard.
ac-chan123
6th April 2005, 20:46
If i'm right, then this was something that mjpegtools createt and is now used by all Video Tools under Linux(ffmpeg, mplayer, transcode, ...)
Some c code can be found at http://parallel.vub.ac.be/~johan/MpegStills/ .
Wilbert
6th April 2005, 21:33
avs2yuv also creates it (it creates planar I420)
http://students.washington.edu/lorenm/src/avisynth/avs2yuv/
akupenguin wrote it. So i'm sure he can help if necessary :)
This is newer c code:
http://cvs.sourceforge.net/viewcvs.py/mjpeg/mjpeg_play/utils/#dirlist
Apperently more colorformats are supported, but simply I420 would be sufficient for now.
WarpEnterprises
7th April 2005, 08:20
1) Good news: if you use avs2yuv with -raw and then RawSource(filename, width, height, "YV12") it works already. When using "I420" U/V are permuted - I'm sorry I confused I420 and YV12.
2) Using the native format will be a little more work, as the frame positions are theoretically not equally spaced (the FRAME header can be different). But if I assume that there is no data in the frame header it makes it much easier. This will be always the case if the stream is not "interlaced mixed" - which AviSynth can't handle AND if there are no "metadata" of variable length.
Wilbert
7th April 2005, 09:30
1) Good news: if you use avs2yuv with -raw and then RawSource(filename, width, height, "YV12") it works already.
I know. Fred asked me about it and he's using TyTool (which outputs YUV4MPEG). So, that's why i asked you. I asked Fred to send a sample stream to me.
When using "I420" U/V are permuted - I'm sorry I confused I420 and YV12.
Are you sure? It's not the case that avs2yuv accidentely outputs YV12? I'm at work, can't check it now.
2) Using the native format will be a little more work, as the frame positions are theoretically not equally spaced (the FRAME header can be different). But if I assume that there is no data in the frame header it makes it much easier. This will be always the case if the stream is not "interlaced mixed" - which AviSynth can't handle AND if there are no
"metadata" of variable length.
I asked Fred to check/ask what kind of YUV4MPEG stuff TyTool outputs. I will let you know if he responds.
btw, what kind of data is "metadata" of variable length?
WarpEnterprises
7th April 2005, 11:15
I attach the specs for the header, there is not mentioned, what exactly the metadata should be used for. Maybe something like DG's hints?
FredThompson
9th April 2005, 05:26
Originally posted by Wilbert
I know. Fred asked me about it and he's using TyTool (which outputs YUV4MPEG). So, that's why i asked you. I asked Fred to send a sample stream to me.
..
I asked Fred to check/ask what kind of YUV4MPEG stuff TyTool outputs. I will let you know if he responds.TyTool's author is now active here as "jdiner". There's some chatting between him and nic over in the MPEG2 encoders area. He's a better source than me for the samples you want. I can grab them as TyTool processes but it's quite awkward.
jdiner
11th April 2005, 06:47
I would be happy to provide some source metrics. I also sent out a PM with the details of what TyTool is doing with it.
I am new to this forum and uncertain what the rules are here for posting, size-wise etc... Until I can get caught up on such then please feel free to make requests and I will fill them as fast as I can.
EDIT: I suppose I should add that I can provide the C++ source I use to make the files, although it is small enough not to be of that much use, and if I can find it the C++ source I wrote to load the files as well. (haven't seen it in a while but a grep search should turn it up if anyone wants to see it.)
--jdiner
WarpEnterprises
12th April 2005, 14:23
check this if it's doing what you thought of:
http://www.avisynth.org/warpenterprises/files/rawsource_25_dll_20050412.zip
FredThompson
12th April 2005, 14:35
Heh, you just might be my hero!
Not, like, in that way...harumph...how bout that football team, yeah!
Wilbert
12th April 2005, 16:08
So, it works for you?
Btw, could you upload a YUV4MPEG sample?
jdiner
14th April 2005, 07:05
Originally posted by Wilbert
So, it works for you?
Btw, could you upload a YUV4MPEG sample?
I have not tested it. Hopefully FredThompson has been able to do so.
Here is a sample y4m file, YUV4MPEG, as requested. It has been packed up as a zip file.
--jdiner
jdiner
14th April 2005, 07:06
Humm. I am used to attachments showing up immediately in other forums. I assume it didn't here because there is some kind of moderator oversight.
Anyway it has been posted, hopefully it will appear here soon.
--jdiner
WarpEnterprises
14th April 2005, 08:02
There were two bugs in the rawsource-DLL. Please try the new version.
(rawsource_25_dll_20050414.zip)
billou2k
14th April 2005, 13:34
Hi thanks WarpEnt for still improving rawsource I think that is a very useful filter indeed!
I've just tried the latest version (20050414) and it looks like when importing raw YV12 the U and V channels are swapped. (swapUV() function fixes the colour problem)
I tried again the same clip with the 2004.05. version and colours are fine.
Could there be some code from the YV12 mode changed by adding the support for YUV4MPEG?
Cheers
Wilbert
14th April 2005, 21:38
@jdiner,
If your sample consists out of one frame (?), then it loads fine :)
jdiner
15th April 2005, 06:46
Originally posted by Wilbert
@jdiner,
If your sample consists out of one frame (?), then it loads fine :)
No. It had several frames in it. 4 I think.
I will have to download what was uploaded and make sure. I will post my results.
EDIT: My appologies. I remember now having to cut it down to get it small enough to post here. There are 2 frames in there.
HEADER FRAME (data) FRAME (data) [EOF]
I can make one of larger sized file with 10 or more frames in it if someone can host it. I will see if I can get my old BSD box un-mothballed. Until that happens anyone want to host a 4 or 5 meg ZIP file?
--jdiner
FredThompson
15th April 2005, 07:26
Cut it into chunks (WinRAR, HJ-Split, etc.) and email it to me. I'll host it and any other samples you want posted.
WarpEnterprises
17th April 2005, 21:49
@billou2k: in the latest version U/V is intentionally swapped since I think it was wrong before. You can use "I420" or "YV12" as format strings, one of them will do it (no need to SwapUV, which of course will work too).
FredThompson
19th April 2005, 01:39
Here's a 29-frame YUV4MPEG sample from jdiner
http://home.mindspring.com/~utils/29frames.rar
WarpEnterprises
19th April 2005, 09:19
29frames.y4m works for me.
ac-chan123
19th April 2005, 14:39
here is an alternate source:
http://www1.mplayerhq.hu/MPlayer/samples/yuv4mpeg2/
Wilbert
20th April 2005, 20:59
29frames.y4m works for me.
If I open the clip it has 28 frames, not 29? (The other had one frame instead of two, perhaps a frame is dropped somewhere ?)
jdiner
25th April 2005, 05:04
Originally posted by Wilbert
If I open the clip it has 28 frames, not 29? (The other had one frame instead of two, perhaps a frame is dropped somewhere ?)
It has 29 frames. I just verified that.
Open it up in a hex editor or your favorite tool for doing such viewing and search for the ASCII string "FRAME".
Everything before the first one is the header, the first occurance marks the transition from the file header into the first frame. Each occurance of frame after that marks the transition to the next frame.
In viewing it in that way it is clear that there are 29 frames. In running it through the currently used compressor it results in 29 output frames.
Would appear that there is still an issues in the current loader code.
--jdiner
WarpEnterprises
25th April 2005, 20:31
Yes, yes, yes, my fault.
http://www.avisynth.org/warpenterprises/files/rawsource_25_dll_20050425.zip
Wilbert
25th April 2005, 21:37
Thumbs up!
jdiner
25th April 2005, 22:39
Originally posted by WarpEnterprises
Yes, yes, yes, my fault.
No insult intended. Just trying to be helpful. :)
--jdiner
Mug Funky
28th August 2005, 08:23
thread resurrection!
i'm playing with rawsource to load uncompressed mov. it's working pretty well on raw video files i've demuxed using mplayer (which couldn't play it, and wasn't very helpful in transmuxing to avi), but the frame headers mean the picture moves by 2 pixels per frame. chroma stays aligned, thankfully.
is it possible to mod rawsource to allow an arbitrary (constant...) header size to be input? or even a header string in hex? (it's "c0ad0a00"). that would be totally awesome, as it's totally stupid that it's so hard to get uncompressed UYVY out of quicktime and put it in avi without converting to RGB first...
rawsource is the closest i've come to getting these files converted (audio is handled fine by mplayer, so it's not a problem), and it's FAST, which is a good thing indeed :)
WarpEnterprises
12th September 2005, 07:07
Can you send me a small sample? (~ 5 frames) I don't understand exactly what you mean.
WarpEnterprises
21st September 2005, 16:02
Try this (you can enter a constant header offset):
http://www.avisynth.org/warpenterprises/files/rawsource_25_dll_20050921.zip
I got a sample with an offset of 1024. The width of the video was 720, but it had strange 304 lines and is interlaced, so you have to use:
RawSource("c:\_video\test2.2vuy",720,304,"UYVY", offset=4*256)
AssumeFieldBased
Weave
I guess the 16 more lines are control data or such, you can simply crop it away.
Tell me if it works for you!
peter100m
22nd September 2005, 10:25
@WarpEnterprises: Thank you for your work! The sample I sent you was indeed interlaced and had a height of 608. The extra lines (608-576) contains the visible vitc-code (and I guess other control data.) The constant header offset works and I've tested this so far with sources from 2 different editing systems.
@Mug Funky: There is no longer any need to go over ffmpeg or mplayer to demux the uncompressed Quicktime files to get the YUV-data. Open the .movs with the new version of Rawsource. One not though: the Quicktime files can not contain any audio or there will be garbage pixels visible (the audio data).
Wilbert
23rd September 2005, 15:55
Just curious. What's vitc-code?
@Mug Funky,
Could you upload 2-3 frames raw mov somewhere? I'd like to have it.
ac-chan123
24th September 2005, 04:56
http://www.google.com/search?q=vitc
peter100m
26th September 2005, 13:41
about VITC: http://en.wikipedia.org/wiki/Vertical_interval_timecode
An image of what the VITC looks like here (http://www.ptr.se/video_stuff/vitc_displayed.jpg) . The white rectangles are bits of information visible in the picture. Note that this image includes the overscan area (which is why we see the VITC).
@Wilbert
I've uploaded two samples that works with the new Rawsource.
The first one is here (http://www.ptr.se/video_stuff/blue_yuv_720x608.rar) (2mb)
RawSource("x:\blue_yuv_720x608.2vuy",720,304, "UYVY",offset=4*256)
AssumeFieldBased()
ComplementParity()
Weave()
AssumeFPS(25)
And the other one (2mb) (http://www.ptr.se/video_stuff/uncompressed_yuv_no_audio_720x486.rar) is an uncompressed Quicktime movie.
RawSource("x:\uncompressed_yuv_no_audio_720x486.mov", 720, 486,"UYVY", offset=48)
edit: url typo
WarpEnterprises
7th October 2005, 13:51
I made a new version of RawSource which can use an index string (or index file).
You can specify the position of the first frame, a fixed interval, two interleaved intervals or only some arbitrary key frames.
http://www.avisynth.org/warpenterprises/index.html#rawsource
To find the intervals a little command line tool is included. It "may" work on YUV files (not with RGB) - it seaches for big blocks of valid YUV data.
peter100m
8th October 2005, 12:43
Nice work WarpEnterprises!
This is really useful! The Yuvscan tool as well!
One issue though: RawSource can't parse the default index file from yuvscan. There's an extra line in the beginning of the file and white spaces on every line. If I remove those it works.
Will try more uncompressed Quicktime sources soon, but so far so good! :)
shorton
11th October 2005, 15:29
Warpenterprises:
Wilbert's been helping me with a project where I'm now trying to import a particular raw YUV format to avoid any color conversions. Thread HERE (http://forum.doom9.org/showthread.php?p=722042#post722042). The author of the format I'm trying to use (drmpeg) says its a:
>> 720x480 4:2:2 YCbCr file in headerless planar format (720*480 bytes of
Y, followed by 360*480 bytes of Cb and then 360*480 bytes of Cr). <<
A sample file is here:
http://www.w6rz.net/ycsd.yuv
It is my understanding these are single frame files.
I need to get Rawsource to read that format if possible. Wilbert may already be working on it (thanks Wilbert!), but I thought I'd mention it here since it's specific to rawsource and Wilbert may not have time to fiddle with it right now.
Any help getting this format to be read properly by Avisynth would be most appreciated.
Presuming Rawsource becomes able to read that format, I've still got to turn those single frames into multiple frames at 59.97fps like Imagesource, but that's a different thing to figure out :)
Thanks guys! Best, Scott
WarpEnterprises
11th October 2005, 20:01
Doesn't give one of
RawSource("d:\avitest\ycsd.yuv",720,480,"I420")
RawSource("d:\avitest\ycsd.yuv",720,480,"YV12")
the correct result? It seems Ok, but the example is too meaningless to tell.
Wilbert
11th October 2005, 20:07
@WarpEnterprises
That sample file is 4:2:2 planar (not 4:2:0).
shorton
11th October 2005, 23:13
Doesn't give one of
RawSource("d:\avitest\ycsd.yuv",720,480,"I420")
RawSource("d:\avitest\ycsd.yuv",720,480,"YV12")
the correct result? It seems Ok, but the example is too meaningless to tell.
Thank you for the help:
I had been trying to open the files directly in the encoders. Both promptly crash either encoder. So per Wilberts suggestion I opened them in Virtualdub. They do open but they are not right. And either image crashes virtualdub on closing.
The image is supposed to look like the attached reduced jpeg:
Wilbert
11th October 2005, 23:28
@WarpEnterprises,
I modified rawsource.cpp a bit. It can open raw YV16 (planar 4:2:2) now and converts it to YUY2.
But it still has the problem that VDub/VDubMod crashes upon exit (removing rawsource.dll outside the plugin folder didn't help).
shorton
11th October 2005, 23:43
Picked up from other thread Here (http://forum.doom9.org/showthread.php?p=722840#post722840). Possibly this thread is more appropriate to get help with Rawsource.
EDIT: Corrected the file descriptions, added comment about working backwards to 4:2:2 known good format may be adequate:
drmpeg's sourcefiles:
I believe this one is 4:2:0 planar format:
http://www.w6rz.net/wbars.yuv
I *think* this one is 4:2:2 Cb Y Cr Y format and is the format drmpeg was shooting for:
http://www.w6rz.net/ycsd.SIF
Also tried:
http://www.w6rz.net/wbars.yuv
We want to use a raw 4:2:2 single frame file. IF someone has an example of a 4:2:2 YCbCr file drmpeg may be able to work backwayrd to produce that file format for me.
test.avs:
#I tried the following (uncommenting the lines sequentially of course)
#All of these opened the image, but it was visually incorrect. All of these #crashed VirtualDub on exit:
# c1 = RawSource("ycsd.yuv", 720, 480, "I420")
# c1 = RawSource("ycsd.yuv", 720, 480, "YV12")
# c1 = Rawsource("ycsd.yuv", 720, 480, "UYVY")
# c1 = RawSource("ycsd.SIF", 720, 480, "YV12")
# c1 = RawSource("ycsd.SIF", 720, 480, "I420")
#These 2 opened the image, it looked visually OK, but it crashed VirtualDub #on exit:
# c1 = RawSource("wbars.yuv", 720, 480, "YV12")
# c1 = RawSource("wbars.yuv", 720, 480, "I420")
AssumeFPS(c1,29.97)
Hope that's of some help.
drmpeg
12th October 2005, 05:47
You forgot to try:
c1 = RawSource("ycsd.SIF", 720, 480, "UYVY")
which I believe should open the image correctly.
Ron
WarpEnterprises
12th October 2005, 11:32
cannot reproduce the crash.
can you give me the complete message?
shorton
12th October 2005, 12:56
You forgot to try:
c1 = RawSource("ycsd.SIF", 720, 480, "UYVY")
which I believe should open the image correctly.
RonRon: No dice. I tried:
c1 = RawSource("ycsd.SIF", 720, 480, "UYVY")
AssumeFPS(c1,29.97)
I attached a screen shot of what it gives.
shorton
12th October 2005, 13:02
cannot reproduce the crash.
can you give me the complete message?You get the standard We're sorry Virtualdub has encountered and error and needs to close. Here is the technical information that produces:
<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="VirtualDub.exe" FILTER="GRABMI_FILTER_PRIVACY">
<MATCHING_FILE NAME="auxsetup.exe" SIZE="16384" CHECKSUM="0xC21C7E7D" BIN_FILE_VERSION="1.0.0.1" BIN_PRODUCT_VERSION="1.0.0.1" PRODUCT_VERSION="1.4" FILE_DESCRIPTION="VirtualDub Setup Utility" COMPANY_NAME=" " PRODUCT_NAME="VirtualDub" FILE_VERSION="1.4" ORIGINAL_FILENAME="Setup.exe" INTERNAL_NAME="Setup" LEGAL_COPYRIGHT="Copyright © 1998-2001 Avery Lee, All Rights Reserved" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.1" UPTO_BIN_PRODUCT_VERSION="1.0.0.1" LINK_DATE="08/07/2005 23:10:13" UPTO_LINK_DATE="08/07/2005 23:10:13" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="vdicmdrv.dll" SIZE="6656" CHECKSUM="0xF8FDB301" BIN_FILE_VERSION="1.0.0.1" BIN_PRODUCT_VERSION="1.0.0.1" PRODUCT_VERSION="1.3" FILE_DESCRIPTION="VirtualDub installable video compressor/decompressor" COMPANY_NAME=" " PRODUCT_NAME="VirtualDub" FILE_VERSION="1.3" ORIGINAL_FILENAME="vdicmdrv.dll" INTERNAL_NAME="vdicmdrv" LEGAL_COPYRIGHT="Copyright © 1998-2000 Avery Lee, All Rights Reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.0.0.1" UPTO_BIN_PRODUCT_VERSION="1.0.0.1" LINK_DATE="08/07/2005 23:10:04" UPTO_LINK_DATE="08/07/2005 23:10:04" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="vdremote.dll" SIZE="7168" CHECKSUM="0xC73C2F6F" BIN_FILE_VERSION="1.5.10.1" BIN_PRODUCT_VERSION="1.5.10.1" PRODUCT_VERSION="1.5.10-sp1" FILE_DESCRIPTION="AVIFile-to-VirtualDub-Frameserver glue library" COMPANY_NAME=" " PRODUCT_NAME="VirtualDub" FILE_VERSION="1.5.10-sp1" ORIGINAL_FILENAME="vdremote.dll" INTERNAL_NAME="vdremote" LEGAL_COPYRIGHT="Copyright © 1998-2004 Avery Lee, All Rights Reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.5.10.1" UPTO_BIN_PRODUCT_VERSION="1.5.10.1" LINK_DATE="08/07/2005 23:10:08" UPTO_LINK_DATE="08/07/2005 23:10:08" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="vdsvrlnk.dll" SIZE="5120" CHECKSUM="0xA25D1808" BIN_FILE_VERSION="1.5.10.1" BIN_PRODUCT_VERSION="1.5.10.1" PRODUCT_VERSION="1.5.10-sp1" FILE_DESCRIPTION="VirtualDub server communication library" COMPANY_NAME=" " PRODUCT_NAME="VirtualDub" FILE_VERSION="1.5.10-sp1" ORIGINAL_FILENAME="vdsvrlnk.dll" INTERNAL_NAME="vdsvrlnk" LEGAL_COPYRIGHT="Copyright © 1998-2004 Avery Lee, All Rights Reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.5.10.1" UPTO_BIN_PRODUCT_VERSION="1.5.10.1" LINK_DATE="08/07/2005 23:10:07" UPTO_LINK_DATE="08/07/2005 23:10:07" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="vdub.exe" SIZE="7738" CHECKSUM="0xAA3D561D" BIN_FILE_VERSION="1.6.5.0" BIN_PRODUCT_VERSION="1.6.5.0" PRODUCT_VERSION="1.6.5" FILE_DESCRIPTION="VirtualDub command-line driver application" COMPANY_NAME=" " PRODUCT_NAME="VirtualDub" FILE_VERSION="1.6.5" ORIGINAL_FILENAME="vdub.exe" INTERNAL_NAME="VirtualDub" LEGAL_COPYRIGHT="Copyright © 2005 Avery Lee" VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.6.5.0" UPTO_BIN_PRODUCT_VERSION="1.6.5.0" LINK_DATE="08/07/2005 23:11:17" UPTO_LINK_DATE="08/07/2005 23:11:17" VER_LANGUAGE="English (United States) [0x409]" />
<MATCHING_FILE NAME="VirtualDub.exe" SIZE="736768" CHECKSUM="0xDB7684B9" BIN_FILE_VERSION="1.6.10.0" BIN_PRODUCT_VERSION="1.6.10.0" PRODUCT_VERSION="1.6.10" FILE_DESCRIPTION="VirtualDub" COMPANY_NAME="" PRODUCT_NAME="VirtualDub" FILE_VERSION="1.6.10" ORIGINAL_FILENAME="VirtualDub.exe" INTERNAL_NAME="VirtualDub" LEGAL_COPYRIGHT="Copyright © 1998-2005 by Avery Lee, All Rights Reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="1.6.10.0" UPTO_BIN_PRODUCT_VERSION="1.6.10.0" LINK_DATE="08/07/2005 23:13:26" UPTO_LINK_DATE="08/07/2005 23:13:26" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
<EXE NAME="rawsource.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
<MATCHING_FILE NAME="rawsource.dll" SIZE="49152" CHECKSUM="0xFBA36F1B" MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" LINK_DATE="10/03/2005 06:31:18" UPTO_LINK_DATE="10/03/2005 06:31:18" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="GRABMI_FILTER_THISFILEONLY">
<MATCHING_FILE NAME="kernel32.dll" SIZE="983552" CHECKSUM="0x4CE79457" BIN_FILE_VERSION="5.1.2600.2180" BIN_PRODUCT_VERSION="5.1.2600.2180" PRODUCT_VERSION="5.1.2600.2180" FILE_DESCRIPTION="Windows NT BASE API Client DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System" FILE_VERSION="5.1.2600.2180 (xpsp_sp2_rtm.040803-2158)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32" LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERFILEDATEHI="0x0" VERFILEDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xFF848" LINKER_VERSION="0x50001" UPTO_BIN_FILE_VERSION="5.1.2600.2180" UPTO_BIN_PRODUCT_VERSION="5.1.2600.2180" LINK_DATE="08/04/2004 07:56:36" UPTO_LINK_DATE="08/04/2004 07:56:36" VER_LANGUAGE="English (United States) [0x409]" />
</EXE>
</DATABASE>
Wilbert
12th October 2005, 14:12
c1 = RawSource("ycsd.SIF", 720, 480, "UYVY")
AssumeFPS(c1,29.97)
Works for me :confused: I zipped all my files in the attached package. Try that (correct all paths in the script) and report back.
shorton
12th October 2005, 15:13
Thanks Wilbert. I had not explicitly called the plugin in my script. Maybe that caused the problem. Anyway, I used the contents of your zip file in it's own directory to ensure nothing else was there to mess with it. I also removed Rawsource.dll from my Avisynth plugin folder before running your sample script where it was called explicitly. I did get the file to open in a more correct looking manner.
Before I remembered to remove the old Rawsource.dll, Virtualdub still crashed on exit. After I removed the old one it did not, however, it does not appear to be closing cleanly still. Inside Virtualdub, the MRU list isn't updated with that file if it's opened then closed.
Also I tried opening the avs in both encoders, both encoders just close instantly as soon as I open the file, without error or message of any sort.
So as I muddle through trying to do the right thing to help you help me, I added to the script to see if I could improve on CCE opening, but it did not work. Specifically for CCE I tried:
LoadPlugin("H:\_Patterns\rawtest\rawsource.dll")
c1=RawSource("H:\_Patterns\rawtest\ycsd.SIF", 720, 480, "UYVY").loop(30)
convertToYUV2(c1)
AssumeFPS(29.97)With this version of the script, both the encoder and Virtual dub just shutdown without error or messages of any kind so maybe I'm doing something wrong in that script?
I don't know if it's related, but I don't think the image is quite right. Attached is a reduced jpeg of what I get. Ron made it and I believe it should look like the jpeg posted previously (post #99). Looks like luma's getting whacked. There should be some background gray on each bar set. Ron will be able to confirm.Nevermind this point, see below
shorton
12th October 2005, 15:31
I don't know if it's related, but I don't think the image is quite right. Attached is a reduced jpeg of what I get. Ron made it and I believe it should look like the jpeg posted previously (post #99). Looks like luma's getting whacked. There should be some background gray on each bar set. Ron will be able to confirm.Nevermind on this particular point. The levels looked off due to using remote control application to get home to files. Once I uploaded the jpeg, then viewed directly (not in remote control application) it looks correct. Excuse static.
So, now how to get it to open in encoder(s) without crashing them?
WarpEnterprises
12th October 2005, 15:52
(1) Ok, crash-bug found (buffer too small by 1)
(2) @shorton: your sample ( http://forum.doom9.org/attachment.php?attachmentid=4766&stc=1 ) looks like the width is slightly wrong.
(3) @Wilbert: is there a sample image of YV16? AFAIK in the above links there are only YUV2 and YV12 samples. I will add your code
(4) I will add display of the actual used byteoffset
Wilbert
12th October 2005, 16:19
(3) @Wilbert: is there a sample image of YV16? AFAIK in the above links there are only YUV2 and YV12 samples. I will add your code
Yes, here: http://www.w6rz.net/ycsd.yuv
From this post: http://forum.doom9.org/showthread.php?p=722022#post722022
shorton
12th October 2005, 20:16
Warpenterprises:
>>(1) Ok, crash-bug found (buffer too small by 1)
Excellent! Anxious to try the revision. Hopefully this will fix the encoder feed crash, too.
>>(2) @shorton: your sample ( http://forum.doom9.org/attachment.php?attachmentid=4766&stc=1 ) looks like the width is slightly wrong.
I think I have #2 solved. I used the copy of the file Wilbert was using and mine opened correctly except for the crashes (encoder).
WarpEnterprises
13th October 2005, 14:19
new version:
* no buffer crash
* YV16 format
* "show" parameter
* index.txt from yuvscan can be used directly
http://www.avisynth.org/warpenterprises/#rawsource
shorton
13th October 2005, 15:04
@Warpenterprises & Wilbert:
Thank you. Very much.
I opened the ycsd.SIF sample file in Virtualdub. Now it appears to have closed closed cleanly, updating the VirtualDub MRU list on the way out.
I also encoded the sample file with CCE using:
LoadPlugin("H:\_Patterns\rawtest\rawsource.dll")
c1 = RawSource("ycsd.SIF", 720, 480, "UYVY").loop(30)
AssumeFPS(c1,29.97)I notice I needed no further conversion function/filter to feed to CCE. No color conversions prior to feeding the encoder is what we were looking for.
It did not crash the encoder. And the resulting mpeg looks correct so far.
Thanks again for the help guys. Sincerely appreciated. I'm going to get with drmpeg for my next steps on my project.
Best, Scott
peter100m
14th October 2005, 09:42
@WarpEnterprises:
Thank you for the new version!
I've been trying it out with some more uncompressed Quicktime files now and noticed a strange behaviour. It works rather well but I can only use files with 5093 frames (720x576) or less.
The index file from Yuvscan has these values:
frame 5068:4242944000
frame 5094:4264710144
frame 5120:4286476288
Using the "show" parameter the byte position for frame 5093 is 4 263 680 000 (image (http://www.ptr.se/video_stuff/rawsource_frame5093.jpg)), and the byte position for frame 5094 is -30 257 152 (image (http://www.ptr.se/video_stuff/rawsource_frame5094.jpg)).
There seems to be an integer overflow somewhere. Would you mind looking that up (Im too novice to find the error in the source)?
thank you!
WarpEnterprises
14th October 2005, 11:40
The bytepos in the indexfile is read not correctly if >4GB. I will change it ASAP.
Meanwhile it should work if you simply leave only the first 4 or 5 entries in the indexfile.
As you can see the difference between every 25 frames is equal, so a "big_delta" of 21766144 (=4264710144 - 4242944000) will be used.
The error is here:
int num2;
...
ret = sscanf(p_del+1, "%d", &num2);
must be:
__int64 num2;
...
ret = sscanf(p_del+1, "%I64d", &num2);
Fizick
2nd November 2005, 06:18
May I ask for frame sequence support ? (like imagesequence, imagereader)
Examples of standard video sequence:
(I420 files)
http://www.cipr.rpi.edu/resource/sequences/sif.html
Fizick
11th December 2005, 23:12
No? It's a pity.
Warpenterprise,
please correct Rawsource documentation:
parameter "filename" is really "file".
WarpEnterprises
14th December 2005, 20:06
not really no :-)
but it doesn't fit nicely.
I'm thinking if if better can be combined with ImageSequence - give me some time.
billou2000
11th April 2006, 14:52
any progress or tricks on the idea of having rawsource also working on single file sequences like imagesequence? (but obviously with raw yuv format files)...
I've been looking at it but couldnt find any solution yet.
ac-chan123
11th April 2006, 22:45
Becauser raw yuv file have no header like the raw sequenezes, simply put them togetter in one file(e.g using cat).
billou2k
12th April 2006, 00:26
ac-chan123: thank you for the idea, I've actually used that workaround in the past but I have several huge sequences to process that way and it is not just possible to do it like that this time. I'm currently looking at the rawsource code to see how that could be done, but i've never coded avisynth plugins
before so that could take some time.
billou2k
12th April 2006, 19:51
I've actually done it:)
It's a quick and dirty mod but it seems to work.
I've tested it succesfully on very long raw UYVY sequences and it should also work on any other format with no headers (I actually ran into problems so I got rid of the header part as I don't work with these kind of files).
NB: it is ONLY for file sequences (1file=1frame).
If someone is interested I'll post the sources somewhere.
Wilbert
12th April 2006, 23:18
If someone is interested I'll post the sources somewhere.
We are always interested :)
billou2k
13th April 2006, 10:21
Here we go, I've called it RawsourceSeq (http://billou2k.free.fr/avisynth/rawsourceSeq_25_dll_20060412.7z), manual is included, it has only been tested by me on UYVY sequences so expect some bugs to occur:)
(all credits go to Warpentreprise, I've just modified Rawsource)
WarpEnterprises
14th April 2006, 21:31
I'm a little bit sorry that I come too late, but I had some other code fragments lying around - so here is my version, too. It is built into imagesequence (as yours it does not use files with header, this makes no sense anyway for single pictures).
http://forum.doom9.org/showthread.php?t=109997
Fizick
28th July 2006, 16:24
I was need in Y8 raw video reading, and make new option to RawSource plugin. Sent it to WarpEnterprises.
WorBry
2nd September 2006, 08:26
I'm trying to import some YUV archive sequences using RawSequence (in ImageSequence),
http://www.ldv.ei.tum.de/page70
The 1080p25 series load OK as the files are straight .yuv and pixel type I420. However, the image files of first three series (576i25, 720p 50/59.94 and 1080i 25/29.97) are in .qnt format and I just cant get then to load.
There are some image converson softs out there that support qnt files but they are either for Macs or costly professional programs (with no demo available).
I'm also having the same problem with some archives in SGI format, which I understand is an 16-Bit RGB variant.
Any idea how I can get these images into a format that ImageSequence will accept?
Cheers.
Edit:
I know DRMPEG has the sequences compiled as HD-MPEG2 transport streams on his webpage
http://www.w6rz.net/
but I would like to output the original image sequences as (FFDShow)HuffYuv-YV12 to serve as reference masters.
I've also found a tool that converts SGI to YUV, but its a command line utility and I havent a clue how to use it:
http://www.ldv.ei.tum.de/media/files/homes/oelbaum/forschung/mpeg/sgi2yuv.zip
WorBry
8th September 2006, 14:36
However, the image files of first three series (576i25, 720p 50/59.94 and 1080i 25/29.97) are in .qnt format and I just cant get then to load.
Got it now; change the file extension from .qnt to .yuv and load in RawSequence as pixel type UYVY (i.e. YUY2) :rolleyes:
Chikuzen
11th January 2011, 10:05
I tried to read a Y4M file generated by ffmpeg with RawSource, but I got a message "YUV4MPEG2 header error." and faild.
Thus, I challenged to modify RawSource a little.
rawsource.zip (http://www.mediafire.com/download.php?0ko43sb1c70o8ux)
Apparently, it seem that I got success in correspondence to the Y4M header that ffmpeg generate(include C tag) and YUV4:2:2 Y4M.
However, I cannot judge whether the method adopted by me is good because only five days has passed since I start the study of C/C++ language.
Please confirm and give me suggestions.
ganymede
11th January 2011, 13:51
I use to generate raw yuv files with ffmpeg (not y4m) :ffmpeg -i yuv_source -an -vcodec rawvideo file.yuv
These files can be read with rawsource, eg. for 720x576 (default size) :RawSource("file.yuv", pixel_type="I420")You can use a different pixel_type argument, and add width and height parameters to adjust size.
Wilbert
11th January 2011, 19:41
I tried to read a Y4M file generated by ffmpeg
Could you upload such a file somewhere?
Chikuzen
11th January 2011, 20:53
@Wilbert
here (http://www.mediafire.com/download.php?b46p4hhb9bzv78k)
Chikuzen
12th January 2011, 06:46
added mono(Y8) colorspace suport on YUV4MPEG2.
rawsource_20110112.zip (http://www.mediafire.com/download.php?wuz7v0kmu247l6s)
sample(mono Y4M) (http://www.mediafire.com/download.php?3bfev3zsvg2gsfe)
Chikuzen
21st May 2011, 15:38
fix and small improvement.
*Fix parsing of YUV4MPEG2 stream header.
*Fix processing of interlaced YUV4MPEG2.
*Add support of ARGB / I422(YUV422planar) / YV411(YVU411planar) / YUV411planar .
sourcecode
https://github.com/chikuzen/RawSource_2.5x
Chikuzen
23rd May 2011, 12:05
updated.
RawSource_25_dll_20110523.zip (http://www.mediafire.com/download.php?f15fxwkkuuif9ha)
*Add ABGR/NV12/NV21 support.
Chikuzen
29th May 2011, 20:47
updated.
RawSource_25_dll_20110529.zip (http://www.mediafire.com/download.php?3bmwyi1lztt4h1j)
note:requires msvcr100.dll
*Change maximal width to 4096.
*Add new parameters fpsnum/fpsden.
Chikuzen
22nd June 2011, 20:05
I rewrited RawSource.dll to support new features(pixel types) of avs2.6.
RawSource_26_dll_20110614.zip (http://www.mediafire.com/download.php?9jkkc7h8ch9lglt)
requirement:
Avisynth2.6.0alpha2 or later
SSE capable CPU
msvcr100.dll
jmac698
6th September 2011, 10:21
Interesting, could someone modify this plugin to read the 10bit v210 format, and display it as the common convertion, where image is double height, with MSB at top and LSB at bottom? In this case, we can now import nicely, the 10bit data and process with existing tools (dither, deband, etc.) and also output to 10bit encode (with avs2yuv and 10bit x264)?
http://wiki.multimedia.cx/index.php?title=V210
It's a pain to decode, but doesn't take too long (I've done it in script).
For samples,
http://forum.doom9.org/showthread.php?t=158836&highlight=v210
Chikuzen
25th September 2011, 13:29
update
*change MAX_WIDTH into 65536
rawsource_26_dll_20110925.zip (http://www.mediafire.com/download.php?a6e6bqxbmrt9uge)
requirement:
Avisynth2.6.0alpha2 or later
SSE capable CPU
msvcr100.dll(Microsoft Visual C++ 2010 Redistributable Package)
jmac698
25th September 2011, 16:19
Updated http://avisynth.org/mediawiki/External_filters#Source_Filters
Do you have a homepage of any type?
unreal666
15th January 2012, 17:27
Chikuzen
Add YV24 in "Supported pixel_types are:" in rawsource26.html .
Chikuzen
31st August 2012, 17:52
update
* extend the size of read buffer to one frame at the maximum, and modify writing algorithm.
rawsource_26_dll_20120831.zip (http://www.mediafire.com/download.php?vfz3ackgiurxi9c)
in the case of reading planar-formats/BGR/BGRA/YUY2, it becomes much(about 4 times?) faster than 20110925.
requirement:
Avisynth2.6.0alpha2 or later
SSE capable CPU
msvcr100.dll(Microsoft Visual C++ 2010 Redistributable Package)
@unreal666
thx, fixed.
LigH
25th August 2013, 16:20
This is now incompatible with AviSynth 2.60 MT beta 4:
Avisynth open failure:
Cache: Filter returned invalid response to CACHE_GETCHILD_CACHE_MODE. 1730941280
Please compile with updated interface, similar to MaskTools2 for AviSynth 2.60 MT alpha 4 (http://forum.doom9.org/showpost.php?p=1619023&postcount=649).
Chikuzen
25th August 2013, 21:00
rawsource26-20130826.zip (http://www.mediafire.com/download/96wth97idn1s5fc/rawsource26-20130826.zip)
LigH
25th August 2013, 21:13
Thanks. Works fine.
Chikuzen
28th May 2016, 18:50
update
source code (https://github.com/chikuzen/RawSource_2.6x)
binary (https://github.com/chikuzen/RawSource_2.6x/releases)
- Add 64bit binary.
- VS2010 to VS2015.
- Registerd as MT_SERIALIZED automatically on Avisynth+ MT.
- clean up code.
requirement:
- Avisynth2.6.0/Avisynth+ r1576 or greater.
- Windows Vista sp2 or later
- Visual C++ redistributable for Visual Studio 2015.
enctac
9th December 2017, 16:22
Hi,Chikuzen.
rawsourceplus-20160814 can't read yuv420p10.y4m(etc.) correctly.
Issue(Japanese)
https://github.com/chikuzen/RawSource_2.6x/issues/1
Chikuzen
26th December 2025, 03:12
Hi
RawSourcePlus has been updated.
rawsourceplus-20251224.zip (https://github.com/chikuzen/RawSource_2.6x/releases/tag/Plus-20251224)
There are many changes, so please read RawSourcePlus.md.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.