Bug Report Media Source .avi playback buffer causing crashes (memory leak?)

deetari

Member
Summary:

Upon adding a frame buffer to the media playback of certain .avi files that will not play without the buffer (possibly just large, uncompressed files), OBS-MP begins consuming memory at a high rate, before eventually crashing. This problem is not exhibited by OBS-vanilla, where the memory consumption stays at a constant value while playing the same .avi files, and where adding a frame buffer is not necessary to play those same files.


Steps to recreate:

Play certain .avi files in OBS-MP with the frame buffer enabled. Note that these same files cannot be played without the frame buffer in OBS-MP.



Version:
0.13.1 (both 32-bit and 64-bit)


More details:

(AVI file info) https://obsproject.com/forum/thread...ausing-crashes-memory-leak.43628/#post-196400

(Extra details) https://obsproject.com/forum/thread...ausing-crashes-memory-leak.43628/#post-196743


I can provide a crash log if necessary, though I'd have to find out where it's saved, first.






===============
original edit:

The .avi files can be played with the use of the frame buffer options, but playing the videos causes OBS-MP's memory consumption to skyrocket and leads to crashes within seconds of starting the videos. The video playback also has lag/stutter, audio desync, and audio/video freezes.

This is in stark contrast to OBS-vanilla, where the memory usage stayed stable and the video playback experienced no slowdown, hiccups, or other issues.


Note that the crash occurs without actually streaming/recording, just with the preview panes active. I've tested with recording, as well, but that didn't change the outcomes.


Both versions of OBS were tested on the same system with the same file.

If wanted, I can provide the crash logs from OBS-MP.

(slightly more info in the more recently made post down below somewhere)

=====
original post:

I hadn't noticed until just today, but the new OBS does not support .avi playback, while the old one did. I used AVISynth to splice together replay files on the fly (and AVFS to show the video in OBS), in the past, but this doesn't appear to work anymore.

I did a cursory search for this topic but didn't immediately see anything relevant (and 'avi' is too short a search term on its own).

Any chance this is an easy adjustment? Or would this be something requiring more time than would be worthwhile?

I've got my fingers crossed, haha.
 
Last edited:

Harold

Active Member
It wasn't removed actually. The media source plugin supports any and all container and codec formats supported by the version of ffmpeg that's in the system.
 

deetari

Member
Huh. I suppose that it works differently from the "video" plugin in the old version of OBS, then? OBS-MP can't seem to play any .avi files that I put into it, though I can play them just fine in MPC/VLC/etc.

Old OBS, on the other hand, plays .avi files just fine.

I would have assumed I had ffmpeg from CCCP or MPC-HC and the likes, but perhaps those don't install all the ffmpeg codecs? Hmm.
 

Harold

Active Member
OBS uses a copy of ffmpeg in its install directory. Those codec packs don't handle that.
 

Jack0r

The Helping Squad
Avi is only a container, it could be a problem of the used codec or an incompatible setting of the encoding. Tested a few .avi files I have, they all work fine.
 

deetari

Member
Ah, thanks for pointing that out. I was thinking that OBS-MP was just ignoring the .avi file I selected due to its extension, but that's pretty obviously wrong.

Not sure if this is helpful, but this is the media info from the avfs-generated .avi file that old OBS can play (apologies for formatting):

===============

General
Complete name :
Format : AVI
Format/Info : Audio Video Interleave
Format profile : OpenDML
File size : 6.08 GiB
Duration : 58s 525ms
Overall bit rate : 892 Mbps

Video
ID : 0
Format : YUV
Codec ID : YUY2
Codec ID/Info : YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel
Duration : 58s 525ms
Bit rate : 884 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 59.940 fps
Color space : YUV
Chroma subsampling : 4:2:2
Compression mode : Lossless
Bits/(Pixel*Frame) : 16.000
Stream size : 6.02 GiB (99%)

Audio
ID : 1
Format : PCM
Format profile : Float
Codec ID : 3
Codec ID/Hint : IEEE
Duration : 58s 525ms
Bit rate mode : Constant
Bit rate : 8 192 Kbps
Channel(s) : 2 channels
Sampling rate : 128 KHz
Bit depth : 32 bits
Stream size : 57.2 MiB (1%)
Alignment : Aligned on interleaves
Interleave, duration : 17 ms (1.01 video frame)
Interleave, preload duratio : 517 ms

============


Not sure what could be making this play on the old version but not the new version. Ack.

For whatever it's worth, the generated .wav file can play just fine, it's only the .avi that doesn't work. Tested in 32-bit and 64-bit, as well.
 

sam686

Member
Video
ID : 0
Format : YUV
Codec ID : YUY2
Codec ID/Info : YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel
Duration : 58s 525ms
Bit rate : 884 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 59.940 fps
Color space : YUV
Chroma subsampling : 4:2:2
Compression mode : Lossless
Bits/(Pixel*Frame) : 16.000
Stream size : 6.02 GiB (99%)
The video is using YUY2 colorspace and is not compressed. 6 Gigabytes for 58 second video?
1280 x 720 x 59.94 (fps) x 2 (bytes/pixel for YUY2) = 105 MB/s, some hard disk can't read this fast.

Maybe try using some compression like HuffYUV, or reduce resolution and frame rate.
 

deetari

Member
Shouldn't be a hard disk issue, since it plays just fine in my media players and in old OBS. I can't adjust that formatting, either, as it's a file that's put together from live-recorded uncompressed footage using avisynth and avfs.
 

deetari

Member
Did some more testing, and found that increasing the video/audio frame buffers in OBS-MP allowed the video files to play, albeit with lag and sound problems, and eventual memory-related crashes.


Interestingly, OBS-vanilla played the video file without issue, and showed a total memory usage of around 480,000K in the task manager while doing so.

OBS-MP, on the other hand, spiked from 200,000K to 500,000K and rapidly climbed to over a million before popping a crash report prompt. Not sure if this a bug (hence my question-mark title change) or if it's just a result of using the frame buffer option, but it's consistently causing a crash within a few seconds of starting the video file.

Note that the crash occurs without actually streaming/recording, just with the preview panes active. I've tested with recording, as well, but that didn't change the outcomes.



Not really sure how to go about fixing this, since it seems to not really be an issue related to the media file itself, and since it seems like OBS-MP can render the files, just... poorly?
 
Last edited:

deetari

Member
Bumping this to see if anyone has some ideas (please do note the updated info). Or should I perhaps just repost this with a different title...?
 

deetari

Member
Final bump before I just make a new thread. (I'd make a new one already, but I'm feeling inexplicably lazy about it)
 

deetari

Member
I don't know if I'd consider re-writing this post as a bug rather than a feature request would count as a duplicate thread. The issue I've run into is no longer the one I initially requested, but rather appears to actually be a bug.
 

deetari

Member
Annnd bump once more. Not really fishing for an easy fix at this point, more just trying to make sure this is a known issue that will hopefully be addressed in the future.
 
Top