amiaopensource / vrecord

Vrecord is open-source software for capturing a video signal and turning it into a digital file.
https://github.com/amiaopensource/vrecord
155 stars 45 forks source link

significant lag in vrecord -a #60

Closed metacynicv2 closed 7 years ago

metacynicv2 commented 8 years ago

There is a 10s delay between the image in the source and the image on the vrecord audio passthrough window (vrecord -a). This makes it difficult to calibrate and make adjustments.

metacynicv2 commented 8 years ago

It is also crashing after several minutes

privatezero commented 8 years ago

I want to fix this!!! But currently this seems to be a limitation of the ffplay filterchains vrecord is using. They just can't keep up once audio information is introduced. For now I would suggest video calibration using the standard passthrough mode, and then using the -a function just for things like confirming your audio signal is coming through to the appropriate channels.

dericed commented 8 years ago

cc'ing @richardpl for any advice on getting streams=dv+da[v][s];[s]asplit=2[z][out1];[z]channelsplit=channel_layout=4.0[s1][s2][s3][s4];[s1][s2][s3][s4]amerge=inputs=4,aformat=channel_layouts=quad[x];[x]showvolume=t=0:h=17:w=200[xx];[v]split=5[a][b][c][d][e];[b]field=top[b1];[c]field=bottom[c1];[b1]${WAVEFORM_FILTER}[b2];[c1]${WAVEFORM_FILTER}[c2];[a][b2][c2]vstack=inputs=3,format=yuv422p[abc1];[d]${VECTORSCOPE_FILTER}[d1];[e]signalstats=out=brng,scale=512:ih[e1];[e1][d1]vstack[de1];[abc1][de1]hstack[abcde1];[abcde1][xx]overlay=10:10[out0] to keep up with a real time standard definition NTSC source.

richardpl commented 8 years ago

I doubt this can be fixed in ffplay, time to switch to something better like mpv?

richardpl commented 8 years ago

Is signalstats metadata stuff mandatory? It appears to be major CPU consumer.

dericed commented 8 years ago

hmmmm, i suppose we could consider audio or signalstats. But when calibrating the video decks I find the signalstats/drawtext combination very helpful.

richardpl commented 8 years ago

I see, what's CPU usage without and with showvolume?

richardpl commented 8 years ago

Either there is no enough CPU power or buffer management in lavfi is bad. Note that even if your CPU have multiple cores lavfi may not use all of them. I could reproduce with mpv somehow. But verbose ffplay output would be helpful. I don't have ffplay right now installed....

privatezero commented 8 years ago

I have been experimenting today with using mpv instead of ffplay for vrecord -a, so far it is looking promising. Seems like it is keeping up with the stream for both a file input source as well as a blackmagic input. It doesn't like the signal stats (visual + numerical) mode yet, however.

Here is the filter chain I have been testing so far: [aid1]asplit=2[z][ao],[z]showvolume=t=0:h=17:w=200[xx],[vid1]split=5[a][b][c][d][e],[b]field=top[b1],[c]field=bottom[c1],[b1]${WAVEFORM_FILTER}[b2],[c1]${WAVEFORM_FILTER}[c2],[a][b2][c2]vstack=inputs=3,format=yuv422p[abc1],[d]${VECTORSCOPE_FILTER}[d1],[e]signalstats=out=brng,scale=512:ih[e1],[e1][d1]vstack[de1],[abc1][de1]hstack[abcde1],[abcde1][xx]overlay=10:10[vo]"

richardpl commented 8 years ago

Too much stacking invocations for my taste, I'm wondering about adding generic stacker which would accepts multiple inputs at once and just copy them to random places in new frame. As a result it would use less memcpy calls.

privatezero commented 8 years ago

Merged this. Still doesn't support numeric information in audiopassthrough, but otherwise everything else seems to be keeping up on this end! Hopefully this helps Kelly!

retokromer commented 7 years ago

What is the status of this issue?

privatezero commented 7 years ago

I assume that the switch to mpv resolved this? It was working fine on our end after the switch.

retokromer commented 7 years ago

Thank you! That was my impression too. Then I close this one.