mpv
mpv copied to clipboard
libmpv: using multiple mpv instances ffmpeg errors are sent to the wrong instance
mpv Information
[ 569.139][v][cplayer] mpv v0.38.0-601-gf470b63a Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
[ 569.139][v][cplayer] built on Jul 12 2024 00:08:04
[ 569.139][v][cplayer] libplacebo version: v7.349.0 (v7.349.0-dirty)
[ 569.139][v][cplayer] FFmpeg version: N-116241-g70c6b904b
[ 569.139][v][cplayer] FFmpeg library versions:
[ 569.139][v][cplayer] libavcodec 61.10.100
[ 569.139][v][cplayer] libavdevice 61.2.100
[ 569.139][v][cplayer] libavfilter 10.2.102
[ 569.139][v][cplayer] libavformat 61.5.101
[ 569.139][v][cplayer] libavutil 59.28.100
[ 569.139][v][cplayer] libswresample 5.2.100
[ 569.139][v][cplayer] libswscale 8.2.100
Other Information
- Windows version:Windows 10 Pro 64-bit (10.0, Build 19045) (19041.vb_release.191206-1406)
- GPU model, driver and version:AMD Radeon(TM) Graphics 31.0.21914.4000
- Source of mpv: https://github.com/wbtcpip2/mpv-winbuild/actions/runs/9899851878
- Introduced in version: since longtime
Reproduction Steps
in my process i run multiple instances of libmpv playing several videos at the same time. for each instance i use MPVSetPropertyString(mpvhandle, "log-file", filename) MPVSetPropertyString(mpvhandle, "msg-level", "all=debug")
lately when i look at the log files i see that ffmpeg errors are sometimes notified to the wrong instance
example, i have one instance only playing a png picture and another instance playing an mp4 video file now take a look to the log of the pngfile: 17092024_211921_DGB32Graphicsbackground2png.txt
in that log you'll see some ffmpeg error related to h264, that errors comes from another instances:
17092024_212108_ZCanzoniCanzoniDJKayzfeatNazaKeblackComDabmp4.txt
Expected Behavior
each mpv instance must log the errors related to the proper instance.
Actual Behavior
randomly ffmpeg/lavf messages of another mpv instance are logged
Log File
log of png image (with h264 errors of another instance) 17092024_211921_DGB32Graphicsbackground2png.txt
log of a h264 stream (there are no errors here, because they was notified to the wrong instance) 17092024_212108_ZCanzoniCanzoniDJKayzfeatNazaKeblackComDabmp4.txt
Sample Files
No response
I carefully read all instruction and confirm that I did the following:
- [X] I tested with the latest mpv version to validate that the issue is not already fixed.
- [X] I provided all required information including system and mpv version.
- [X] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of
--log-file=output.txt. - [X] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
- [X] I attached the full, untruncated log file.
- [X] I attached the backtrace in the case of a crash.
av_log_set_callback() sets logging callback for all libav libraries, there is no separation. So it will log to one of the mpv instances always.
ok understood. do you think would it be possible at least to have the callback set on the last runned instance? generally ffmpeg errors occurs on the first seconds of playback so it would be usefull to log on the last running instance
I just recently faced this issue as well. I have 2 instances of MPV running and if one stream fails to open, it affects the other stream. And when I look at the FFMPEG logs returned by MPV, I can see that the logs are mismatched, i.e., the logs which should be for the MPV instance that fails to load the stream, show up in the logs for the other MPV instance.
Is there no workaround for this?