Closed MartinPulec closed 1 year ago
well, seems a bit weird, it is reproducible with (source here) file capture:
uv -s embedded -t file:Sintel-1080i59.mp4 -d decklink -r embedded # but not
uv -s embedded -t testcard:mode=Hi59 -d decklink -r embedded
so it seem to be related to file vidcap after all
Testing with your file, and it is no longer crashing. But throwing tons of audio decode errors.
[lavc mp3float @ 0x7f62a8250100] overread, skip -5 enddists: -4 -4 [lavc mp3float @ 0x7f62a810c940] overread, skip -5 enddists: -1 -1 [Audio decompress] Empty channel returned ! [lavc mp3float @ 0x7f62a81eaf00] overread, skip -5 enddists: -4 -4 [Audio decompress] Empty channel returned ! [lavc mp3float @ 0x7f62a81eaf00] overread, skip -6 enddists: -2 -2 [Audio decompress] Empty channel returned ! [Decklink display] audio buffer underflow! [Audio decompress] Empty channel returned ! [Audio decompress] Empty channel returned ! [lavc mp3float @ 0x7f62a8250100] overread, skip -6 enddists: -4 -4 [Audio decompress] Empty channel returned ! [Audio decompress] Empty channel returned ! [Decklink display] audio buffer underflow! [lavc mp3float @ 0x7f62a8250100] overread, skip -6 enddists: -2 -2 [Audio decompress] Empty channel returned ! [lavc mp3float @ 0x7f62a810c940] overread, skip -6 enddists: -1 -1 SSRC 0x64a18796: 3328/3328 packets received (100.0000%), 0 lost, max loss 0 SSRC 0x53d55501: 9728/9728 packets received (100.0000%), 0 lost, max loss 0 [Audio decompress] Empty channel returned ! [Audio decoder] Received 2288640/2288640 B, decoded 172908 samples in 5.01 sec. [Audio decompress] Empty channel returned !
Testing with your file, and it is no longer crashing.
is this related really to this issue? Because I didn't resolve the issue yet and also it didn't exhibit with the crash
The root of the problem is that first GOP of H.264 file is not decoded, eg.:
uv -s embedded -t file:~/Videos/Sintel-1080i59.mp4 | grep 'File cap.'
[File cap.] Video format: 1920x1080 @59.94i, codec UYVY
Error decoding video frame (Resource temporarily unavailable)
[File cap.] Error while decoding frame (rc == -11): Resource temporarily unavailable.
[ the above 2 lines repeat several times ]
But audio frames are captured normally. When the displaying/playback device on the other side is a DeckLink, it causes audio overflow from the reason that no video frames are to be matched with the audio. Slight improvement can be achieved when disabling multi-threaded decode: -t file:<opts>:threads=0
.
Just to be clear what you are saying, because of the GOP thats why the audio and video are causing a problem on the switch? So assuming I make all I frames it should be fine... ?
Testing with your file, and it is no longer crashing.
is this related really to this issue? Because I didn't resolve the issue yet and also it didn't exhibit with the crash
Yes when I test with your file instead of my sample file, everything seems to work fine and no longer crash. I suspect the issue is coming down to how the audio channels are being handled. I will continue to play with it to see if I can make it crash. I belive my sample file was not at the same frame rate and audio channels as my decklink source.
Just to be clear what you are saying, because of the GOP thats why the audio and video are causing a problem on the switch? So assuming I make all I frames it should be fine... ?
Well, P-frames won't matter as well. In theory yes, but A/V delay problem may not just be related to B-frames but also thread-level parallelized decoding, which also adds N frame delay (where N -1is the count of threads; toggled on by default in file vidcap). So using a file without B-frames and running file:<name>:threads=0
wouldn't induce any A/V delay.
Yes when I test with your file instead of my sample file, everything seems to work fine and no longer crash.
But this issue is not dedicated to any crash but only the vidcap file A/V delay problem. Feel free to create an additional issue - I'd do it by myself, but I don't know what was the problem. Also solving [Audio decompress] Empty channel returned !
above might be useful - I cannot solve it because I don't have any steps to reproduce.
I think giving you ssh access to my test setup might be more useful. I believe the setup is the same as it was before, but I would have to check the forwarding rules in the firewall. Let me know if you would be interested.
The issue is closed, but I am still thinking that you may be mixing here some other problem.
The thing is that running uv -s embedded -t file:Sintel-1080i59.mp4 -d decklink -r embedded
should newer give [lavc mp3float @ 0x7f62a8250100] overread
error. MP3 isn't used anywhere (transmission not compressed, input file has AAC).
I think giving you ssh access to my test setup might be more useful.
From the above, I don't think that I'll be able to reproduce it - using the above-mentioned command should never give me that error even in your setup.
Never mind, I've managed to reproduce it in the end (#327) so there potentially remains only the crash, but in this case I am not able to deduce the problem without additional info.
UPDATE: As far as for the crashing, if you were testing with mp3 compressed transmission, I believe that commit 83f8d559 (2023-06-13) should have turned it really into #327. So in that case, it would be no longer an issue, indeed.
Originally posted by @TheSashmo in https://github.com/CESNET/UltraGrid/issues/316#issuecomment-1587527412
Quoted original issue:
Great news the audio does work in this method and I can get the audio from the file as well. But I think a bit of understanding is still needed. Here are my commands:
When switching from decklink to file, a ton of audio buffer overflow messages a thrown in the decoder logs.
This happens at every time the file loops itself as well.