PDA

View Full Version : DirectShow access crash


bartnovsky
29th June 2009, 23:24
I need to simultaneously capture and encode video(via x264) and sound(via ffmpeg to mp3, for example) from BlackMagic Intensity capture card. Here is simple script, which i used for this purpose:
v = DirectShowSource("video.grf", audio=false, fps=25, framecount=4000).ConvertToYV12
a = DirectShowSource("sound.grf", video=false, fps=25, framecount=4000)
AudioDub(a,v)
where "video.grf" and "sound.grf" are the corresponding capture graphs. When i launch encoding separately, everything is fine. But parallel starting of encoding processes from command line leads to breakdown of the one (the other is working correctly at the same time). Here are examples of error messages:
[ffmpeg]:
Input #0, avs, from 'sony_1080i.avs':
Duration: 00:00:10.00, start: 0.000000, bitrate: 0 kb/s
Stream #0.0: Video: rawvideo, rgb32, 804x80, 49397 kb/s, 24.00 tb(r)
Output file does not contain any stream
[x264]:
avis [error]: unsupported input format (DIB )
x264 [error]: could not open input file 'sony_1080i.avs'
The usage of two separate avs scripts cannot solve this problem. Everything is fine also when i use *.avi clip in the first call of DirectShowSource. Could anyone help or suggest more convenient way to achive the goal described above?

IanB
30th June 2009, 00:51
"rgb32, 804x80" That is the shape of an error message clip.

You are between a rock and a hard place. You need to see the text of that error message to proceed.

Maybe something like this will help you move forwardTry {
v = DirectShowSource("video.grf", audio=false, fps=25, framecount=4000).ConvertToYV12
a = DirectShowSource("sound.grf", video=false, fps=25, framecount=4000)
AudioDub(a,v)
}
Catch(err_msg) {
WriteFileStart("log.txt", err_msg)

# or perhaps

# BlankClip(100, 804, 80, pixel_type="YV12")
# Subtitle(err_msg)
}

Gavino
30th June 2009, 02:34
WriteFileStart("log.txt", err_msg)
Since the parameter to WriteFileStart is an expression, not the value itself, this needs to be:

WriteFileStart("log.txt", "err_msg")

bartnovsky
1st July 2009, 22:33
Thanks a lot for advice! I solved this problem by such a stupid way:

The error message was:
"DirectShowSource:GRF file does not have a compatible video pin.
Graph must have 1 output pin that will bid RGB24, RGB32, ......
(.....\sony_1080i.avs line 2 (or line 1))
It seems that the call of DirectShowSource from first encoder blocked the access to GRF-files for second encoder. So I tryed to use video and audio capture graphs separatly from different scripts, but ffmpeg crashed when was becoming to encode audio from capture graph! I think this is the problem of ffmpeg software because the same graph is normally rendered by, for example, Classic Media Player (I hear my voice with little delay). Then i substituted *.avi-video instead of "video.grf", and audio-stream have been encoded correctly. Could anyone suggest any command line-operated mp3 encoder, which can use avs scripts on input or capture audio directly?