PDA

View Full Version : Crash on capturing video via grf and avisynth


bartnovsky
10th June 2009, 13:20
Here is the problem i can't get over for a week now...

I capture video from my BlackMagic Intensity Pro card (using HDMI) as follows: i created a very simple graph (using GraphStudio tool from K-Lite codec pack) which captures Full HD video signal from camera

http://i717.photobucket.com/albums/ww179/bartnovsky/graph_capture.jpg

The graph is opened by avisynth, here's the script:

DirectShowSource("sony_1080i.grf",audio=false,fps=25, framecount=250).ConvertToYV12

And this file is given to x264.exe for encoding:

x264.exe (some encoding opts) script.AVS -o video_output.mp4 1920x1080

And here is what i see:
sometimes i launch my batch with x264 and it works just fine, the other times i launch it and i see something like this:

http://i717.photobucket.com/albums/ww179/bartnovsky/x264_stucks-1.jpg

and it is just stuck.

I tried launching it many times. Sometimes it may be launched 10 times in a raw, and after 20 times it is stuck.

I also tried using ffmpeg instead of x264 for encoding, but ffmpeg doesn't want to transcode in real time at all! It trascodes video, but there is only message "CAVIStreamSynth: System exception - Acces Violation at 0x0, reading from 0x0" on this video.

x264 being replaced by mencoder just crashes on start, unless i decrease resolution of video with BelinearResize(640,480). Then it works fine.

Could anyone say what is wrong here?..

kemuri-_9
10th June 2009, 17:18
I also tried using ffmpeg instead of x264 for encoding, but ffmpeg doesn't want to transcode in real time at all! It trascodes video, but there is only message "CAVIStreamSynth: System exception - Acces Violation at 0x0, reading from 0x0" on this video.

x264 being replaced by mencoder just crashes on start, unless i decrease resolution of video with BelinearResize(640,480). Then it works fine.

Could anyone say what is wrong here?..

sounds like you're getting memory allocation fails from running out of allocatable memory (on the x86 platform) due to your large resolution...

generally should use the x64 version of x264 if you have an x64 os available.

IanB
10th June 2009, 23:49
With capture graphs, you must be able to fetch the data faster then the incoming frame rate, i.e. the capture frame rate must be the limiting factor. If not then the incoming capture data will very quickly exhaust all the capture driver buffers, looks like your Declink driver crashes when this happens.

Also you must not seek! Add Seek=False to your DirectShowSource() call to make sure this is true, and add ChangeFPS(Last, True) to allow a little out of order frame access from the Avisynth cache.

Encoding 1920x1080 in real time is a very big ask. Test by replacing the source with an appropriately configured BlankClip(), To have any hope your encode must be able to do better than 35 or 40 fps. You will need that headroom to allow for the cpu cycles used by the capture script.