Log in

View Full Version : Create video using single frames via rawsource


shorton
11th October 2005, 16:06
Greetings:

I'm working on a project to serve raw YCbCr encoded "stills" to CCE and/or QuEnc. I'm getting some help reading my particular raw YUV file format with Rawsource via a different thread.

If Wilbert, Warpenterprises, gurus et.al. are able to tweak Rawsource to allow reading of my raw YUV files, I'm one step closer. I can see the next hurdle though and figured a different thread would be appropriate for this Rawsource usage question.

Until we decided to use Rawsource, I was reading RGB bmp's using Imagesource i.e.:

ImageSource("somefile.bmp", end = 59, fps = 29.97)

But now I'll hopefully be reading my raw YUV files with Rawsource i.e.

Rawsource("somefile.yuv", 720, 480, "UYVY")

Each raw file is one frame. How can I construct/serve the same 60 frames at 29.95 fps as I did with Imagesource example above? Duplicate the function line 60 times in my avs script? That's fine if that's the way, but I don't know what to do about the frame rate.

I will be opening the avs and serving frames (if that's the right way to say it) directly with my mpeg encoders CCE/QuEnc.

Hopefully this is a easy question for you guys experienced with Avisynth. I'm still learning it (obviously :)).

Thanks very much for the time to help. Best, Scott

Wilbert
11th October 2005, 16:20
Each raw file is one frame. How can I construct/serve the same 60 frames at 29.95 fps as I did with Imagesource example above? Duplicate the function line 60 times in my avs script? That's fine if that's the way, but I don't know what to do about the frame rate.

Rawsource("somefile.yuv", 720, 480, "UYVY")
Loop(60)
AssumeFPS(29.97)

shorton
11th October 2005, 16:47
Excellent, that was easy (for you maybe:)).

If I have multiple different files can I repeat the functions as in:
Rawsource("somefile.yuv", 720, 480, "UYVY")
Loop(60)
Rawsource("somefile2.yuv", 720, 480, "UYVY")
Loop(60)And if I can, is one:
AssumeFPS(29.97)at the end sufficient, or do I need to apply it at every loop?

Thanks Wilbert!

Wilbert
11th October 2005, 16:59
You forgot to chain your sources (in your script only the last yuv file is returned). Thus

c1 = Rawsource("somefile.yuv", 720, 480, "UYVY")
c2 = Loop(c1,60)
c3 = Rawsource("somefile2.yuv", 720, 480, "UYVY")
c4 = Loop(c3,60)
c5 = c2+c4
AssumeFPS(c5,29.97)

or a bit shorter

c1 = Rawsource("somefile.yuv", 720, 480, "UYVY").Loop(60)
c3 = Rawsource("somefile2.yuv", 720, 480, "UYVY").Loop(60)
c1+c3
AssumeFPS(29.97)

shorton
11th October 2005, 17:19
Great, thanks Wilbert. That cleared this question up. This also helped me understand a lot about how these scripts work. Your patient help with my inexperienced questions is sincerely appreciated. I'm learning fast.

Now all I need is the Rawsource modification and I'm in business :)

Thanks again, Scott

video_magic
3rd December 2005, 13:40
Thanks a lot from mr too Wilbert! :) I found this chain option exactly what I wanted. I am making a DVD menu, and I just wanted the main background image that it is made from to change 4 times - I am making a still image be encoded into the m2v for the menu. This is the script I made, I wish I had known about chain before, a search for chain on www.avisynth.org doesn't show it!

c1 = ImageSource("D:\atmp\Lemmi\lemmidvd\4dvd\blackholecrop_ready2.bmp", end=987, fps=25)
c2 = ImageSource("D:\atmp\Lemmi\lemmidvd\4dvd\catacha_ready2.bmp", end=987, fps=25)
c3 = ImageSource("D:\atmp\Lemmi\lemmidvd\4dvd\mask__ready2.bmp", end=987, fps=25)
c4 = ImageSource("D:\atmp\Lemmi\lemmidvd\4dvd\angel_of_deception_ready2.bmp", end=987, fps=25)
c1+c2+c3+c4
ConvertToYV12()

That script works great, thanks again :)

Leak
4th December 2005, 16:11
I wish I had known about chain before, a search for chain on www.avisynth.org doesn't show it!
Well, the term used for it all over AviSynth is "splice" (http://www.avisynth.org/Splice)... ;)

np: Scorn - Falling (Autechre - Fr 13 Mix) (Ellipsis)