Log in

View Full Version : Intermittent error "Cannot trim if there is no video"


rangi500
18th November 2008, 14:18
Hello,

I'm using a transcoding software called Procoder to transcode off avs files like this:


Try {

count = DirectShowSource("F:\source_file.mpg").framecount
DirectShowSource("F:\source_file.mpg", seekzero=true)
Trim(738, count-488)

# (some other bits here, stripped out for readability)

} catch(err_msg) {

BlankClip()
WriteFileStart ("F:\error_log.txt", "err_msg")
}


Intermittently (say 1 in 10 times) the "Trim" line doesn't work, the first time the avs script is accessed, and the message "Cannot trim if there is no video" appears in the error log. Accessing the script a second time works fine.

Does anyone have any idea what might cause this?

Any help much appreciated!
Rangi

Guest
18th November 2008, 14:24
DirectShowSource() is not reliable for frame counts, especially when you invoke it twice in the same script.

Consider MPEG2Source() instead.

Gavino
18th November 2008, 19:24
Indeed, and there's no need to invoke the source filter twice anyway.
Write it like this:

try{
MPEG2Source(...)
Trim(738, framecount()-488)
...