YaLTeR / vapoursynth-rs

A safe Rust wrapper for VapourSynth.
Apache License 2.0
31 stars 8 forks source link

--start argument does not work in vspipe example #12

Open redzic opened 3 years ago

redzic commented 3 years ago

Hi there, it seems like the --start argument does not work for the vspipe example (but it does work for regular vspipe). Just outputting the entire file seems to work fine though. Running this command: cargo run --example vspipe --release --features=vapoursynth-functions,vsscript-functions -- -y input.vpy -s 2600 -e 2800 /dev/null

where input.vpy looks like this:

import vapoursynth as vs

core = vs.get_core()

video = core.ffms2.Source("source.mkv")
video.set_output()

results in only outputting the first 32 frames and then exiting. stderr looks like this:

Output 32 frames in 0.71 seconds (45.26 fps)
vspipe time: 0.81 seconds

I suspect it may have something to do with this line: https://github.com/YaLTeR/vapoursynth-rs/blob/052853d44b70e91d5c0eb11c33c9d62dbc9a79eb/vapoursynth/examples/vspipe.rs#L528

Since it requests the first index at 0 instead of the first frame.

YaLTeR commented 3 years ago

Hmm yeah, I might've overlooked that. I don't remember how the code works any more, but a quick glance suggests it should use something along last_requested_frame + n + 1 because last_requested_frame seems to be initialized to the start frame.