Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmpv: using multiple mpv instances ffmpeg errors are sent to the wrong instance #14880

Open
6 tasks done
wbtcpip2 opened this issue Sep 17, 2024 · 2 comments
Open
6 tasks done

Comments

@wbtcpip2
Copy link

wbtcpip2 commented Sep 17, 2024

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:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • 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.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@kasper93 kasper93 changed the title libmpv win32: using multiple mpv instances ffmpeg errors are sent to the wrong instance Sep 18, 2024
@kasper93 kasper93 removed the os:win label Sep 18, 2024
@kasper93
Copy link
Contributor

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.

@wbtcpip2
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants