Page 1 of 2

AVF decoder janky interactions, turns to solid colors

Posted: Fri Jul 13, 2018 12:56 am
by geoffmatters
This has been happening since early betas in an unpredictable fashion, and it is super disruptive, but I didn't have a good reliable repro until now.

AVF sometimes renders video as a random solid color.

Repro: I have the same footage encoded a MJPG and HAP. Put both in modul8, in two layers, move them left and right so I can watch both at the same time. In the media info tab, verify that MJPG version defaulted to FFMPEG decoder, and HAP is only supported by AVF. Switch the MJPEG clip to use AVF decoder. The hap clip turns to a solid brown.

Obviously this should never happen, and it is extra odd that decoding of different clips in different layers is not hermetic. The fact that different clips can impact eachother through the decoding library means I have some projects that are very unstable; making simple changes (swap a media in a layer) sometimes totally breaks something somewhere else or later in the performance.

Re: AVF decoder janky interactions, turns to solid colors

Posted: Fri Jul 13, 2018 1:42 am
by geoffmatters
Screenshot showing the corrupted AVF decoder

Re: AVF decoder janky interactions, turns to solid colors

Posted: Fri Jul 20, 2018 10:43 am
by Pierre Guilluy
I've been trying to reproduce your problem but couldn't using the movie files I have.

Could you send me a link to your two HAP & MJEG files in a PM?

Re: AVF decoder janky interactions, turns to solid colors

Posted: Mon Jul 30, 2018 5:12 pm
by Pierre Guilluy
I finally could try to reproduce your problem using the files you provided without success: whatever I change the actual player of the MJPEG file doesn't have any effect on the HAP files currently playing.

What version of macOS are running Modul8 on?

Re: AVF decoder janky interactions, turns to solid colors

Posted: Tue Jul 31, 2018 1:49 pm
by Pierre Guilluy
Also, what GPU are you running Modul8 on?

Re: AVF decoder janky interactions, turns to solid colors

Posted: Wed Aug 01, 2018 6:41 am
by geoffmatters
Thanks for looking into it. Too bad it isn't an easy repro on your end.

The computer I did that test on was OSX 10.12.6 on MacBook Pro (15-inch, 2016) [the touchbar one] with Radeon Pro 455 and Intel HD Graphics 530.

I don't have that computer with me now, but I'll see if I can repro on a different computer and send a zip file.

I *think* I had restarted modul8, but if I did cmd-N for new project, then probably the decoding helper process stuck around, and there might be a deeper history involved in producing the bad output.

Re: AVF decoder janky interactions, turns to solid colors

Posted: Sat Aug 04, 2018 11:10 am
by geoffmatters
I spent a while trying to repro on my MacBook Pro (Retina, 15-inch, Mid 2015) AMD Radeon R9 M370X 2048 MB Intel Iris Pro 1536 MB

Haven't been able to. In a few weeks i'll have access to the touchbar model on which I made the above repro.

Re: AVF decoder janky interactions, turns to solid colors

Posted: Fri Aug 17, 2018 7:50 am
by geoffmatters
I again have access to the computer that repro. Playing with latest RC3, am unable to repro. <shrug>
Will update if I see the symptom again during real performances.

Re: AVF decoder janky interactions, turns to solid colors

Posted: Tue Aug 28, 2018 1:24 pm
by geoffmatters
Stumbled on a repro.

Load HAP and PJPG versions of the same clip
Play HAP in layer 1
Play PJPG in layer 1
Switch PJPG from FFMPEG to AVF
Switch it back to FFMPEG

Result: goes solid black. The HAP version also plays as black. This persists even if I delete and recreate the layer. I can tell is it playing back because playhead progresses, and I can verify that there are pixels there by adding red to the layer.

Re: AVF decoder janky interactions, turns to solid colors

Posted: Tue Aug 28, 2018 1:31 pm
by geoffmatters
Note that in its final state, the HAP clip is using AVF and the PJPG clip is using FFMPEG, and the output from both is a solid color frame (as with previous repro, the color seems to be taken from the video content which in this case is almost but not quite perfect black; in the )previous repro it was a dark red matching that content)

Re: AVF decoder janky interactions, turns to solid colors

Posted: Tue Aug 28, 2018 1:35 pm
by geoffmatters
The machine for this was my MacBook Pro (Retina, 15-inch, Mid 2015) AMD Radeon R9 M370X 2048 MB Intel Iris Pro 1536 MB

So, I have seen this bug on two different generations of macbook

Re: AVF decoder janky interactions, turns to solid colors

Posted: Thu Sep 06, 2018 4:31 am
by geoffmatters
Simpler repro steps:

load a pjpg mov into layer 1
switch decoder to avf
switch back to ffmpeg

reproed 5/5 attempts, quitting m8 each time

I have extra VTDecoderXPCService processes hanging around when m8 isn't running so quit them and try again

still repros

PS - double-checked that "automatic graphics switching" has been disabled this whole time

MacBook Pro (Retina, 15-inch, Mid 2015) AMD Radeon R9 M370X 2048 MB Intel Iris Pro 1536 MB

Re: AVF decoder janky interactions, turns to solid colors

Posted: Thu Sep 06, 2018 4:55 am
by geoffmatters
fresh restart, still repros

Re: AVF decoder janky interactions, turns to solid colors

Posted: Thu Sep 06, 2018 11:45 am
by Pierre Guilluy
VTDecoderXPCService is the process that's launched by AVFoundation when dealing with legacy codecs that can't run in the same process.

What I notice is how smooth the AVFoundation playback is compared with using FFmpeg. Do you experience the same on your side?

I still can't reproduce on my 2017 MBP but I will test on a different system asap.

Re: AVF decoder janky interactions, turns to solid colors

Posted: Thu Sep 06, 2018 4:23 pm
by geoffmatters
I also noticed that, I mentioned in the "august version issues" thread that performance regressed vs 2.9.2 (at least with the RC3 default ffmpeg decoder) for at least some of my HD files

Thanks for hunting the "solid frame" problem.