obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
58.69k stars 7.81k forks source link

Recording 1080p 60fps Crashes FFMPEG Encoder #3254

Closed HurricanePootis closed 1 year ago

HurricanePootis commented 4 years ago

Platform

Operating system and version: Arch Linux 5.7.12 OBS Studio version: 25.0.8-1

Expected Behavior

I set the level to 4.2, which proclaims that it supports up to 1080p 60fps output, and it should record/stream at 1080p 60fps

Current Behavior

OBS tells me encoder overload after a second of recording/streaming at 1080fps 60fps.

Attempted path: share/obs/obs-studio/locale/en-US.ini
Attempted path: /usr/share/obs/obs-studio/locale/en-US.ini
Attempted path: share/obs/obs-studio/locale.ini
Attempted path: /usr/share/obs/obs-studio/locale.ini
Attempted path: share/obs/obs-studio/themes/Dark.qss
Attempted path: /usr/share/obs/obs-studio/themes/Dark.qss
info: CPU Name: AMD Ryzen 5 2600 Six-Core Processor
info: CPU Speed: 3784.795MHz
info: Physical Cores: 6, Logical Cores: 12
info: Physical Memory: 16018MB Total, 2743MB Free
info: Kernel Version: Linux 5.7.12-24-tkg-pds
info: Distribution: "Arch Linux" Unknown
info: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.8
info: Portable mode: false
qt.svg: Cannot open file '/usr/share/obs/obs-studio/themes/Dark/Close.svg', because: No such file or directory
qt.svg: Cannot open file '/usr/share/obs/obs-studio/themes/Dark/Close.svg', because: No such file or directory
qt.svg: Cannot open file '/usr/share/obs/obs-studio/themes/Dark/Popout.svg', because: No such file or directory
qt.svg: Cannot open file '/usr/share/obs/obs-studio/themes/Dark/Popout.svg', because: No such file or directory
Attempted path: share/obs/obs-studio/themes/Dark/no_sources.svg
Attempted path: /usr/share/obs/obs-studio/themes/Dark/no_sources.svg
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_clicked()
QMetaObject::connectSlotsByName: No matching signal for on_advAudioProps_destroyed()
QMetaObject::connectSlotsByName: No matching signal for on_actionGridMode_triggered()
QMetaObject::connectSlotsByName: No matching signal for on_program_customContextMenuRequested(QPoint)
info: OBS 25.0.8-1 (linux)
info: ---------------------------------
info: ---------------------------------
info: audio settings reset:
    samples per sec: 48000
    speakers:        2
info: ---------------------------------
info: Initializing OpenGL...
info: Loading up OpenGL on adapter X.Org Radeon RX 580 Series (POLARIS10, DRM 3.37.0, 5.7.12-24-tkg-pds, LLVM 10.0.0)
info: OpenGL loaded successfully, version 4.6 (Core Profile) Mesa 20.2.0-devel (git-ba6cdb275c), shading language 4.60
info: ---------------------------------
info: video settings reset:
    base resolution:   1920x1080
    output resolution: 1920x1080
    downscale filter:  Bicubic
    fps:               60/1
    format:            NV12
    YUV mode:          601/Partial
info: NV12 texture support not available
info: Audio monitoring device:
    name: Default
    id: default
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
warning: A DeckLink iterator could not be created.  The DeckLink drivers may not be installed
info: No blackmagic support
error: os_dlopen(libnvidia-encode.so.1->libnvidia-encode.so.1): libnvidia-encode.so.1: cannot open shared object file: No such file or directory

info: FFMPEG VAAPI supported
info: VLC found, VLC video source enabled
info: ---------------------------------
info:   Loaded Modules:
info:     libobs-linuxbrowser.so
info:     vlc-video.so
info:     text-freetype2.so
info:     rtmp-services.so
info:     obs-x264.so
info:     obs-transitions.so
info:     obs-outputs.so
info:     obs-libfdk.so
info:     obs-filters.so
info:     obs-ffmpeg.so
info:     linux-v4l2.so
info:     linux-pulseaudio.so
info:     linux-jack.so
info:     linux-decklink.so
info:     linux-capture.so
info:     linux-alsa.so
info:     image-source.so
info:     frontend-tools.so
info:     decklink-ouput-ui.so
info: ---------------------------------
info: ==== Startup complete ===============================================
error: obs-data.c: [obs_data_create_from_json] Failed reading json string (-1): wrong arguments
QLayout: Attempting to add QLayout "" to OBSBasic "OBSBasic", which already has a layout
info: All scene data cleared
info: ------------------------------------------------
info: pulse-input: Server name: 'pulseaudio 13.0'
info: pulse-input: Audio format: s16le, 48000 Hz, 2 channels
info: pulse-input: Started recording from 'alsa_output.pci-0000_1d_00.1.hdmi-stereo-extra5.monitor'
info: [Loaded global audio device]: 'Desktop Audio'
info: pulse-input: Server name: 'pulseaudio 13.0'
info: pulse-input: Audio format: s16le, 48000 Hz, 1 channels
info: pulse-input: Started recording from 'alsa_input.usb-BLUE_MICROPHONE_Blue_Snowball_797_2018_07_06_44629-00.mono-fallback'
info: [Loaded global audio device]: 'Mic/Aux'
info:     - filter: 'Compressor' (compressor_filter)
info: xcompcap: [window-capture: 'Window Capture (Xcomposite) 2'] update settings:
    title: xfce4-panel
    class: xfce4-panel
    Bit depth: 32
    Found proper GLXFBConfig (in 368): yes

info: xshm-input: Geometry 1920x1080 @ 0,0
info: xshm-input: Geometry 1920x1080 @ 0,0
info: Switched to scene 'Streaming'
info: ------------------------------------------------
info: Loaded scenes:
info: - scene 'Scene':
info:     - source: 'Screen Capture (XSHM)' (xshm_input)
info:     - source: 'Window Capture (Xcomposite) 2' (xcomposite_input)
info:     - source: 'Window Capture (Xcomposite) 3' (xcomposite_input)
info: - scene 'Streaming':
info:     - source: 'Image' (image_source)
info:     - source: 'Window Capture (Xcomposite)' (xcomposite_input)
info:     - source: 'Chat Bot' (linuxbrowser-source)
info:     - source: 'Alert Bot' (linuxbrowser-source)
info:     - source: 'Event List' (linuxbrowser-source)
info: - scene 'Desktop':
info:     - source: 'Screeeen' (xshm_input)
info: - scene 'Recording':
info:     - source: 'Image' (image_source)
info:     - source: 'Window Capture (Xcomposite) 4' (xcomposite_input)
info: ------------------------------------------------
[0805/183754.821696:ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
[0805/183754.823307:ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
Attempted path: share/obs/obs-studio/images/overflow.png
Attempted path: /usr/share/obs/obs-studio/images/overflow.png
[0805/183754.832496:ERROR:sandbox_linux.cc(364)] InitializeSandbox() called with multiple threads in process gpu-process.
info: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: Mic/Aux)

[0805/183755.314463:INFO:CONSOLE(2)] "Cannot process message.", source: https://streamlabs.com/mixed/assets/widgets/js/eventlist.custom.js?id=c5fd6d26bb72aec32763 (2)
[0805/183755.886645:INFO:CONSOLE(0)] "Uncaught (in promise) Something went wrong.", source: https://streamlabs.com/widgets/chat-box/v1/ED4B4A200E81E25381C8 (0)
[0805/183756.156737:INFO:CONSOLE(2)] "host:false", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.157631:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.157648:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.157915:INFO:CONSOLE(2)] "follow:true", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.158111:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.158123:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.158403:INFO:CONSOLE(2)] "sub:true", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.158460:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.158471:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.158770:INFO:CONSOLE(2)] "bits:true", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.158823:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.158834:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159053:INFO:CONSOLE(2)] "raid:false", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159095:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159105:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159304:INFO:CONSOLE(2)] "sub:true", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159356:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159365:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159719:INFO:CONSOLE(2)] "donation:true", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159757:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.159766:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.161122:INFO:CONSOLE(2)] "merch:false", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.161201:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.161216:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.161694:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.161714:INFO:CONSOLE(2)] "custom:false", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.162022:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.162058:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.162520:INFO:CONSOLE(2)] "facemaskdonation:true", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.162564:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.162578:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.162894:INFO:CONSOLE(2)] "loyalty_store_redemption:true", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.162932:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.162957:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.163204:INFO:CONSOLE(2)] "prime_sub_gift:true", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.163221:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.163237:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.163585:INFO:CONSOLE(2)] "sponsored_campaign:false", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.163783:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
[0805/183756.163799:INFO:CONSOLE(2)] "i", source: https://streamlabs.com/mixed/assets/widgets/js/alertbox.js?id=aa4fd7fd9e5543216d10 (2)
info: ---------------------------------
info: [FFMPEG VAAPI encoder: 'streaming_h264'] settings:
    device:       /dev/dri/renderD128
    rate_control: CBR
    profile:      578
    level:        42
    qp:           0
    bitrate:      6000
    maxrate:      6000
    keyint:       120
    width:        1920
    height:       1080
    b-frames:     0

[h264_vaapi @ 0x5625349c7a00] Driver does not support some wanted packed headers (wanted 0xd, found 0).
info: libfdk_aac encoder created
info: libfdk_aac bitrate: 320, channels: 2
info: libfdk_aac encoder created
info: libfdk_aac bitrate: 320, channels: 2
info: libfdk_aac encoder created
info: libfdk_aac bitrate: 160, channels: 2
info: libfdk_aac encoder created
info: libfdk_aac bitrate: 160, channels: 2
info: libfdk_aac encoder created
info: libfdk_aac bitrate: 160, channels: 2
info: libfdk_aac encoder created
info: libfdk_aac bitrate: 160, channels: 2
info: ==== Recording Start ===============================================
info: [ffmpeg muxer: 'adv_file_output'] Writing file '/home/borowski/Desktop/2020-08-05 18-38-31.mkv'...
[matroska @ 0x559020896b00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[matroska @ 0x559020896b00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[matroska @ 0x559020896b00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[matroska @ 0x559020896b00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[matroska @ 0x559020896b00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[matroska @ 0x559020896b00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[matroska @ 0x559020896b00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
info: [ffmpeg muxer: 'adv_file_output'] Output of file '/home/borowski/Desktop/2020-08-05 18-38-31.mkv' stopped
info: Output 'adv_file_output': stopping
info: Output 'adv_file_output': Total frames output: 104
info: Output 'adv_file_output': Total drawn frames: 110 (114 attempted)
info: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 4 (3.5%)
info: ==== Recording Stop ================================================
info: Video stopped, number of skipped frames due to encoding lag: 28/107 (26.2%)
info: libfdk_aac encoder destroyed
info: libfdk_aac encoder destroyed
info: libfdk_aac encoder destroyed
info: libfdk_aac encoder destroyed
info: libfdk_aac encoder destroyed
info: libfdk_aac encoder destroyed

Steps to Reproduce

  1. Open OBS
  2. Use FFMPEG Vaapi as output
  3. Set level to 4.2
  4. Set output to 1080p 60fps (I use a bitrate of 6000)
  5. Record/Stream
  6. Crash

Additional information

I installed a custom patch to OBS that allowed me to record with h.265 through Vaapi, and I was able to record at 1080p 60fps with that.

Fenrirthviti commented 4 years ago

Please provide the GDB backtrace of the crash.

HurricanePootis commented 4 years ago

Please provide the GDB backtrace of the crash.

I am not sure how to do a GDB backtrace of a crash. Sorry.

kkartaltepe commented 4 years ago

Until a backtrace is provided there is nothing we can do to help here, since this is likely a crash in your graphics drivers vaapi impl.

HurricanePootis commented 4 years ago

After some fiddling around, I managed to core dump obs-ffmpeg when it was overloading, and I got this when I ran the coredump through gdb coredump If I did something, please let me know. This was my first time doing something like this.

kkartaltepe commented 4 years ago

im not really sure what process you followed, but it looks like you are loading from a core dump which doesnt match the executables so there are no symbols... GDB recommends you use /home/borowski/obs-studio-portable/bin/64bit/obs-ffmpeg-mux to source the symbols perhaps you instead tried /home/borowski/obs-studio-portable/obs-plugins/64bit/obs-ffmpeg.so ?

Preferably run OBS in gdb to produce a usable backtrace with accurate symbols.

HurricanePootis commented 4 years ago

Is this good? second take

kkartaltepe commented 4 years ago

Are you sure that obs is not crashing? What if you attach gdb to obs instead of the muxer?

HurricanePootis commented 4 years ago

Because a coredump wasn't generated for ffmpeg.

EricWF commented 4 years ago

I believe the crash I'm encountering is the same one mentioned here. Here's a stacktrace:

#4 0x00007fb430dccb24 avcodec_find_best_pix_fmt_of_list ./debian/standard/src/libavcodec/imgconvert.c:74:27
#5 0x00007fb40430db76 create_video_stream <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:224:19
#6 0x00007fb40430db76 init_streams <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:374:8
#7 0x00007fb40430db76 ffmpeg_data_init <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:604:7
#8 0x00007fb40430fd1d try_connect <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:1133:12
#9 0x00007fb40430fd1d start_thread <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:1173:7
#10 0x00007fb42ec73f27 start_thread /build/glibc-M65Gwz/glibc-2.30/nptl/pthread_create.c:480:7
#11 0x00007fb42eba32ef clone /build/glibc-M65Gwz/glibc-2.30/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97:0
fish: “obs” terminated by signal SIGSEGV (Address boundary error)

The stack trace elements before entry #4 all belong to the signal handler.

elsandosgrande commented 3 years ago

@hdemiray This is regarding FFmpeg VA-API, which is Linux-only.

Lepidos commented 3 years ago

I'm experiencing the same issue. Crash when recording, but no crash when streaming. (FFmpeg VA-API).

kkartaltepe commented 3 years ago

I believe the crash I'm encountering is the same one mentioned here. Here's a stacktrace:

#4 0x00007fb430dccb24 avcodec_find_best_pix_fmt_of_list ./debian/standard/src/libavcodec/imgconvert.c:74:27
#5 0x00007fb40430db76 create_video_stream <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:224:19
#6 0x00007fb40430db76 init_streams <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:374:8
#7 0x00007fb40430db76 ffmpeg_data_init <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:604:7
#8 0x00007fb40430fd1d try_connect <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:1133:12
#9 0x00007fb40430fd1d start_thread <some-prefix>/obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-output.c:1173:7
#10 0x00007fb42ec73f27 start_thread /build/glibc-M65Gwz/glibc-2.30/nptl/pthread_create.c:480:7
#11 0x00007fb42eba32ef clone /build/glibc-M65Gwz/glibc-2.30/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97:0
fish: “obs” terminated by signal SIGSEGV (Address boundary error)

The stack trace elements before entry #4 all belong to the signal handler.

This is from an old version and was fixed long ago. Unrelated to the actual issue.

I'm experiencing the same issue. Crash when recording, but no crash when streaming. (FFmpeg VA-API).

Provide a stack trace please.

Lepidos commented 3 years ago
Thread 53 "obs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffefaffd700 (LWP 2460)]
0x00007ffff6a1d4a6 in ?? () from /lib/x86_64-linux-gnu/libavcodec.so.58
#0  0x00007ffff6a1d4a6 in  () at /lib/x86_64-linux-gnu/libavcodec.so.58
#1  0x00007ffff7068135 in avcodec_open2 () at /lib/x86_64-linux-gnu/libavcodec.so.58
#2  0x00007fffc401b479 in open_video_codec (data=0x5555563eb950) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:154
#3  0x00007fffc401b479 in create_video_stream (data=0x5555563eb950) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:254
#4  0x00007fffc401b479 in init_streams (data=0x5555563eb950) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:377
#5  0x00007fffc401b479 in ffmpeg_data_init (data=data@entry=0x5555563eb950, config=config@entry=0x7ffefaffc200) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:607
#6  0x00007fffc401bf00 in try_connect (output=0x5555563eb940) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:1127
#7  0x00007fffc401bf00 in start_thread (data=0x5555563eb940) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:1167
#8  0x00007ffff4cadea7 in start_thread () at /lib/x86_64-linux-gnu/libpthread.so.0
#9  0x00007ffff4bddd8f in clone () at /lib/x86_64-linux-gnu/libc.so.6
kkartaltepe commented 3 years ago

And all of your settings please.

Lepidos commented 3 years ago

obs

Lepidos commented 3 years ago

Is there any other way I can view the settings? OBS crashes on startup prompt if I choose optimize for recording. h264_vaapi is also not working for Recording

abbasmaheryar commented 3 years ago

h264_vaapi and hevc_vaapi is not working for me either. i'm running drivers from mesa-git, an AUR package. I'm using an rx 580 on Arch Linux

kkartaltepe commented 3 years ago

Provide a stack trace from gdb.

abbasmaheryar commented 3 years ago

Provide a stack trace from gdb.

I ran obs with gdb, but when I click record, instead of crashing due to a segfault, the program hangs and I am forced to kill the gdb process.

I don't know if this will be useful, but here is the output from running strace . Pardon me for providing such a large stack trace, but I am pretty sure you can find what you are looking for at the very last few lines of the file.

Here are my settings: pic-window-210228-1940-54

Chiitoo commented 3 years ago
Thread 53 "obs" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffefaffd700 (LWP 2460)]
0x00007ffff6a1d4a6 in ?? () from /lib/x86_64-linux-gnu/libavcodec.so.58
#0  0x00007ffff6a1d4a6 in  () at /lib/x86_64-linux-gnu/libavcodec.so.58
#1  0x00007ffff7068135 in avcodec_open2 () at /lib/x86_64-linux-gnu/libavcodec.so.58
#2  0x00007fffc401b479 in open_video_codec (data=0x5555563eb950) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:154
#3  0x00007fffc401b479 in create_video_stream (data=0x5555563eb950) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:254
#4  0x00007fffc401b479 in init_streams (data=0x5555563eb950) at /home/lepidos/Downloads/obs-studio-26.1.1/plugins/obs-ffmpeg/obs-ffmpeg-output.c:377

This is probably something different, and starts somewhere between FFmpeg 4.2.4 and 4.3.1. Resolution, FPS, or other settings don't seem to matter. With 4.2.4 I'm getting an invalid argument message, and with 4.3.1 or 4.4 this segfault (first time I'm trying out VAAPI with OBS Studio; it does seem to work with plain FFmpeg).

Here's a snippet of the same with some more symbols:

#0  0x00007ffff71569e3 in ff_vaapi_encode_close (avctx=avctx@entry=0x7fff4c0d44c0) at src/libavcodec/vaapi_encode.c:2542
        ctx = 0x7fff4c004f40
        pic = <optimized out>
        next = <optimized out>
#1  0x00007ffff7156ab7 in vaapi_encode_h264_close (avctx=0x7fff4c0d44c0) at src/libavcodec/vaapi_encode_h264.c:1229
        priv = 0x7fff4c004f40
#2  0x00007ffff6ced080 in avcodec_open2 (avctx=0x7fff4c0d44c0, codec=0x7ffff7771840 <ff_h264_vaapi_encoder>, options=0x0) at src/libavcodec/avcodec.c:447
        ret = -22
        codec_init_ok = -1
        tmp = 0x0
        avci = 0x7fff4c0d4a40
#3  0x00007fffc006222a in open_video_codec (data=0x5555569b9910)
    at [...]/plugins/obs-ffmpeg/obs-ffmpeg-output.c:154
        context = 0x7fff4c0d44c0
        opts = 0x7fff4c024420
        ret = 32767
#4  0x00007fffc0062737 in create_video_stream (data=0x5555569b9910)
    at [...]/plugins/obs-ffmpeg/obs-ffmpeg-output.c:254
        closest_format = AV_PIX_FMT_VAAPI_VLD
        context = 0x7fff4c0d44c0
        ovi = 
          {graphics_module = 0x555555832569 "libobs-opengl.so.0", fps_num = 30, fps_den = 1, base_width = 1280, base_height = 720, output_width = 1280, output_height = 720, output_format = VIDEO_FORMAT_NV12, adapter = 0, gpu_conversion = true, colorspace = VIDEO_CS_709, range = VIDEO_RANGE_PARTIAL, scale_type = OBS_SCALE_BICUBIC}

Once I've done some more looking into it, I'll open a separate issue, if still necessary.

gxalpha commented 1 year ago

Closing as this has been determined to be a dependency issue with specific versions of FFmpeg. Additionally, Custom FFmpeg Output is a scenario that we very much discourage.