Belini Posted April 22, 2023 Author Share Posted April 22, 2023 Just the fact that you are trying already makes me more excited and I hope this will be resolved and it will be possible to use LibVlc.au3, thank you very much for your attention. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Belini Posted April 23, 2023 Author Share Posted April 23, 2023 (edited) @genius257 just now I saw that your quote saying you had a possible solution was from 2017, so without your help resolving the freezes it will be impossible for anyone to use this LilVlc.au3 EDITED: Actually all freezes stopped with @Danp2 tip not to use libvlc_media_player_set_hwnd() and maybe now it can be easier to figure out how to embed the vlc window in an autoit gui without freezing them. Opening in VLC window (Direct3D output) if you can determine the size, position and showing without borders would also solve the problem since without embedding in an Autoit window there are no more freezes. Edited April 23, 2023 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
genius257 Posted April 23, 2023 Share Posted April 23, 2023 Hi @Belini. After googling a bit more i found a page explaining the cause of the freezing issue better: https://github.com/ZeBobo5/Vlc.DotNet/wiki/Vlc.DotNet-freezes-(don't-call-Vlc.DotNet-from-a-Vlc.DotNet-callback). I will do some testing with and without the libvlc_media_player_set_hwnd. Due to race conditions the issue has, on average ~50% change of triggering in my experience, so i will verify if it works. If the temporary solution works, I imagine it got something to do with attaching the player to a hwnd not owned by the libvlc process causes the player calls to be affected by the main program GUI message loop. I also found a thread that suggest this problem is still in libvlc v3, but v4 solves this by introducing an async version of these calls. Biggest issue is that v4 is still in pre-release, so I'm not sure how stable it is yet. Zedna 1 My highlighted topics: AutoIt Package Manager, AutoItObject Pure AutoIt, AutoIt extension for Visual Studio Code Github: AutoIt HTTP Server, AutoIt HTML Parser Link to comment Share on other sites More sharing options...
Werty Posted April 23, 2023 Share Posted April 23, 2023 (edited) 7 hours ago, Belini said: Opening in VLC window (Direct3D output) if you can determine the size, position and showing without borders would also solve the problem since without embedding in an Autoit window there are no more freezes. You can cut off borders of windows with _WinAPI_SetWindowRgn() and _WinAPI_CreateRectRgn(), here's an example where I do it with the Irrlicht render window which then gets embedded in an AutoIt gui, you can adjust it to that VLC window you mentioned... ;Embed Irrlicht RenderWindow--------------------------------------------------------------------------------------- _IrrStart($IRR_EDT_opengl, 1024, 768, $IRR_BITS_PER_PIXEL_32, $IRR_windowed, $IRR_SHADOWS, $IRR_capture_EVENTS, $IRR_VERTICAL_SYNC_Off) _IrrSetWindowCaption( "IrrLicht Window") _WinAPI_SetWindowRgn(WinGetHandle("IrrLicht Window", ""), _WinAPI_CreateRectRgn(3, 22, 1024, 768)) ; Cut off IrrLicht Window Border WinMove("IrrLicht Window", "", -3, -22) ; It wants to be moved before set as child for some reason, not vice versa. _WinAPI_Setparent(WinGetHandle("IrrLicht Window", ""), $Gui); Set as child for autoit window WinActivate("AutoIt Window") GUISetState() ;-------------------------------------------------------------------------------------------------------------------- or post an example of that VLC window so I can give it a try. Using autoit to embed the vlc window in an autoit gui using _WinAPI_SetParent is perhaps better than having vlc embedding itself, just a guess, Edited April 24, 2023 by Werty Zedna 1 Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
Belini Posted April 24, 2023 Author Share Posted April 24, 2023 (edited) @genius257 I'm really hoping that you can solve this problem and finally everyone will be able to use your udf. @Werty I'm going to test what you suggested too to see if it does what I need, if you want to test in the vlc window you can download the files from here https://mega.nz/file/oZtRmKhY#P_-Emf9I8fW5xyKIW9d--rhgJuT46zzt6RK9_gpEEXo and to not embed in the Autoit window just comment this line libvlc_media_player_set_hwnd() Edited April 25, 2023 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Belini Posted April 25, 2023 Author Share Posted April 25, 2023 @Werty I couldn't make the vlc video occupy the whole screen using _ WinAPI _ Setparent() as you suggested, there's always a piece missing from the screen and I think it would only work if I get commands to open the vlc video in full screen before using it _ WinAPI _ Setparent() to embed the video in my window, I'm now trying commands to open the vlc video in full screen. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
KaFu Posted April 25, 2023 Share Posted April 25, 2023 If it's all not going to work, I made very good use of MPlayer in AMT, can be embedded and controlled via StdoutRead and StdoutWrite. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Belini Posted April 25, 2023 Author Share Posted April 25, 2023 @Kafu what commands did you use to embed Mplayer in your project? I really wanted vlc using only its lib but if I can't I'll have to go for other options. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
KaFu Posted April 25, 2023 Share Posted April 25, 2023 This is a sample command line without embedding (for you to have a sample for the other settings). "C:\Program Files (x86)\AMT\AMT_Binaries\MPlayer-r38407_x64\AMT-MPlayer.exe" -vo directx -identify -vf screenshot -msglevel all=5 -lavdopts wait_keyframe -monitorpixelaspect 1 -priority abovenormal -progbar-align 95 -nofs -nodr -double -noslices -font "C:\WINDOWS\fonts\verdana.ttf" -subfont-autoscale 3 -subfont-osd-scale 4 -subfont-outline 1 -subfont-blur 1 -noautosub -colorkey 0 -input nodefault-bindings -noconsolecontrols -nofontconfig -nomouseinput -nosound -ao null -af volume=-200:0 -osdlevel 3 -lavdopts threads=4 "C:\_Data\movie.mp4" Here's a pseudocode for assigning the control to be used as a display. Global $c_Picture_Preview = GUICtrlCreateLabel("", 480, 12, 320, 240, $SS_BITMAP) GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) Global $h_Picture_Preview = GUICtrlGetHandle($c_Picture_Preview) Global $s_MPlayer_ARGs_Embed= "-slave -wid " & Number($h_Picture_Preview) & " " Add $s_MPlayer_ARGs_Embed before the "-identify" in the command-line. "-slave" disables keyboard for MPlayer and slaves it to StdoutRead and StdoutWrite. Use something like this to start MPlayer. $i_PID_MPlayer = Run($run_dos_cmd_line, $AMT_AppDataDir & "\AMT_Temp\screenshots\current\", @SW_HIDE, $STDERR_MERGED + $STDIN_CHILD) StdinWrite($i_PID_MPlayer, "pause" & @LF) ; start MPlayer paused StdinWrite($i_PID_MPlayer, "pausing screenshot" & @LF) StdinWrite($i_PID_MPlayer, "pausing seek -60 0" & @LF) StdinWrite($i_PID_MPlayer, "pause" & @LF) StdinWrite($i_PID_MPlayer, "quit" & @LF) @LF is important to trigger the command for MPlayer. Use something like this to check MPlayers response. Local $StdoutRead_Buffer = "" Local $StdoutRead_Line = "" Do $StdoutRead_Line = StdoutRead($i_PID_MPlayer) $StdoutRead_Buffer &= $StdoutRead_Line If StringInStr($StdoutRead_Buffer, 'Exiting... (End of file)', 2) Then _Log_Update($i_Current_Shoot & ': MPLAYER - EOF, end of file reached-1') ExitLoop 2 EndIf If StringLen($StdoutRead_Buffer) > 32768 Then _Log_Update($i_Current_Shoot & ": SEEK ERROR - $StdoutRead_Buffer > 32768 characters-1") ConsoleWrite("! SEEK ERROR - $StdoutRead_Buffer > 32768 characters" & @CRLF) ExitLoop 2 EndIf StringReplace($StdoutRead_Buffer, "Too many buffered pts", "") If @extended > 10 Then _Log_Update($i_Current_Shoot & ": SEEK ERROR - Too many buffered pts-1") ConsoleWrite("! SEEK ERROR - Too many buffered pts" & @CRLF) ExitLoop 2 EndIf StringReplace($StdoutRead_Buffer, "Unexpected decoder output", "") If @extended > 10 Then _Log_Update($i_Current_Shoot & ": SEEK ERROR - Unexpected decoder output-1") ConsoleWrite("! SEEK ERROR - Unexpected decoder output" & @CRLF) ExitLoop 2 EndIf Until StringInStr($StdoutRead_Buffer, "Starting playback...", 2) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Belini Posted April 25, 2023 Author Share Posted April 25, 2023 (edited) @kafu I tried to add the player but it didn't even open. #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> Global $gui = GUICreate("Test Mplayer", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) global $hWnd = WinGetHandle("Test Mplayer") GUISetState(@SW_SHOW) Global $s_MPlayer_ARGs_Embed = "-slave -wid " & Number($hWnd) & " " $run_dos_cmd_line = "mplayer.exe -vo directx " & $s_MPlayer_ARGs_Embed & "-identify -msglevel all=5 -lavdopts wait_keyframe -monitorpixelaspect 1 -priority abovenormal -progbar-align 95 -nofs -nodr -double -noslices -font C:\WINDOWS\fonts\verdana.ttf -subfont-autoscale 3 -subfont-osd-scale 4 -subfont-outline 1 -subfont-blur 1 -noautosub -colorkey 0 -input nodefault-bindings -noconsolecontrols -nofontconfig -nomouseinput -nosound -ao null -af volume=-200:0 -osdlevel 3 -lavdopts threads=4 03205.mp4" $i_PID_MPlayer = Run($run_dos_cmd_line, "", @SW_HIDE, $STDERR_MERGED + $STDIN_CHILD) ;StdinWrite($i_PID_MPlayer, "pause" & @LF) ; start MPlayer paused While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EDIT: This way worked #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> Global $gui = GUICreate("Test Mplayer", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) global $hWnd = WinGetHandle("Test Mplayer") GUISetState(@SW_SHOW) Global $s_MPlayer_ARGs_Embed = "-slave -wid " & Number($hWnd) & " " #cs $run_dos_cmd_line = "mplayer.exe -vo directx " & $s_MPlayer_ARGs_Embed & "-identify -msglevel all=5 -lavdopts wait_keyframe -monitorpixelaspect 1 -priority abovenormal -progbar-align 95 -nofs -nodr -double -noslices -font C:\WINDOWS\fonts\verdana.ttf -subfont-autoscale 3 -subfont-osd-scale 4 -subfont-outline 1 -subfont-blur 1 -noautosub -colorkey 0 -input nodefault-bindings -noconsolecontrols -nofontconfig -nomouseinput -nosound -ao null -af volume=-200:0 -osdlevel 3 -lavdopts threads=4 03205.mp4" $i_PID_MPlayer = Run($run_dos_cmd_line, "", @SW_HIDE, $STDERR_MERGED + $STDIN_CHILD) #ce $i_PID_MPlayer = Run("mplayer.exe -vo direct3d " & $s_MPlayer_ARGs_Embed & "-identify -noborder 03205.mp4", @ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) sleep(10000) StdinWrite($i_PID_MPlayer, "pause" & @LF) ; start MPlayer paused While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd It works but I get a message on the console "Your system is too SLOW to play this!" ************************************************ **** Your system is too SLOW to play this! **** ************************************************ Possible reasons, problems, workarounds: - Most common: broken/buggy _audio_ driver - Try -ao sdl or use the OSS emulation of ALSA. - Experiment with different values for -autosync, 30 is a good start. - Slow video output - Try a different -vo driver (-vo help for a list) or try -framedrop! - Slow CPU - Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts, e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all. - Broken file - Try various combinations of -nobps -ni -forceidx -mc 0. - Slow media (NFS/SMB mounts, DVD, VCD etc) - Try -cache 8192. - Are you using -cache to play a non-interleaved AVI file? - Try -nocache. Read DOCS/HTML/en/video.html for tuning/speedup tips. If none of this helps you, read DOCS/HTML/en/bugreports.html. Edited April 25, 2023 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
KaFu Posted April 25, 2023 Share Posted April 25, 2023 This works fine for me, added some performance related switches to the command-line. expandcollapse popup#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> Global $gui = GUICreate("Test Mplayer", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) Global $hWnd = WinGetHandle("Test Mplayer") GUISetState(@SW_SHOW) Global $s_MPlayer_ARGs_Embed = "-slave -wid " & Number($hWnd) & " " #cs $run_dos_cmd_line = "mplayer.exe -vo directx " & $s_MPlayer_ARGs_Embed & "-identify -msglevel all=5 -lavdopts wait_keyframe -monitorpixelaspect 1 -priority abovenormal -progbar-align 95 -nofs -nodr -double -noslices -font C:\WINDOWS\fonts\verdana.ttf -subfont-autoscale 3 -subfont-osd-scale 4 -subfont-outline 1 -subfont-blur 1 -noautosub -colorkey 0 -input nodefault-bindings -noconsolecontrols -nofontconfig -nomouseinput -nosound -ao null -af volume=-200:0 -osdlevel 3 -lavdopts threads=4 03205.mp4" $i_PID_MPlayer = Run($run_dos_cmd_line, "", @SW_HIDE, $STDERR_MERGED + $STDIN_CHILD) #ce $i_PID_MPlayer = Run("mplayer.exe -vo direct3d " & $s_MPlayer_ARGs_Embed & "-identify -noborder -priority abovenormal -lavdopts threads=4 -noslices test.mov", @ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) ; StdinWrite($i_PID_MPlayer, "pause" & @LF) ; start MPlayer paused Local $b_Playback_Started = False While 1 Local $StdoutRead_Buffer = "" Local $StdoutRead_Line = "" Do $StdoutRead_Line = StdoutRead($i_PID_MPlayer) $StdoutRead_Buffer &= $StdoutRead_Line If StringInStr($StdoutRead_Buffer, 'Exiting... (End of file)', 2) Then ConsoleWrite('Exiting... (End of file)' & @CRLF) Exit 3 EndIf If StringLen($StdoutRead_Buffer) > 32768 Then ConsoleWrite("! $StdoutRead_Buffer > 32768 characters" & @CRLF) ; Exit EndIf StringReplace($StdoutRead_Buffer, "Too many buffered pts", "") If @extended > 10 Then ConsoleWrite("! Too many buffered pts" & @CRLF) ; Exit EndIf StringReplace($StdoutRead_Buffer, "Unexpected decoder output", "") If @extended > 10 Then ConsoleWrite("! ERROR - Unexpected decoder output" & @CRLF) Exit 4 EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Until StringInStr($StdoutRead_Buffer, "Starting playback...", 2) Or $b_Playback_Started $b_Playback_Started = True If $StdoutRead_Buffer Then ConsoleWrite($StdoutRead_Buffer) WEnd Zedna and Belini 1 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Belini Posted April 26, 2023 Author Share Posted April 26, 2023 @Kafu now runs without slowdown messages, everything seems right and I'm going to do other tests to see if I can use Mplayer in my project, thanks for indicating and for giving these precious tips. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Belini Posted April 26, 2023 Author Share Posted April 26, 2023 @Kafu unfortunately Mplayer won't work for me because I can't resize its window without black bars to put in my Autoit Gui and also because I couldn't disable the deinterlace function of this player, in VLC using the executable I managed to do all this but I really wanted to use libvlc instead of using the vlc executable, now it's just a case of waiting and hoping that @genius257 manages to solve the problems in libvlc.au3 My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
KaFu Posted April 26, 2023 Share Posted April 26, 2023 To cover the whole window, e.g. tweak the aspect ratio in WM_EXITSIZEMOVE. To disable deinterlacing add the videofilter -vf yadif=1. expandcollapse popup#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> Global $gui = GUICreate("Test Mplayer", 400, 400, 0, 0, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) Global $hWnd = WinGetHandle("Test Mplayer") GUISetState(@SW_SHOW) Global $s_MPlayer_ARGs_WID = " -wid " & Number($hWnd) & " " #cs $run_dos_cmd_line = "mplayer.exe -vo directx " & $s_MPlayer_ARGs_Embed & "-identify -msglevel all=5 -lavdopts wait_keyframe -monitorpixelaspect 1 -priority abovenormal -progbar-align 95 -nofs -nodr -double -noslices -font C:\WINDOWS\fonts\verdana.ttf -subfont-autoscale 3 -subfont-osd-scale 4 -subfont-outline 1 -subfont-blur 1 -noautosub -colorkey 0 -input nodefault-bindings -noconsolecontrols -nofontconfig -nomouseinput -nosound -ao null -af volume=-200:0 -osdlevel 3 -lavdopts threads=4 03205.mp4" $i_PID_MPlayer = Run($run_dos_cmd_line, "", @SW_HIDE, $STDERR_MERGED + $STDIN_CHILD) #ce $i_PID_MPlayer = Run("mplayer.exe -vo direct3d -slave " & $s_MPlayer_ARGs_WID & " -identify -vf yadif=1 -noborder -priority abovenormal -lavdopts threads=4 -noslices -colorkey 0 test.mov", @ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) #cs http://mplayerhq.hu/pipermail/mplayer-users/2011-December/083810.html There are three different approaches: 1) If you have a Nvidia graphic card and if you are using the binary drivers, you can use -vo vdpau:deint=3 2) You can use yadif: -vf yadif=1 is best quality (including frame duplication), if your hardware is not fast enough, try -vf yadif=3, -vf yadif=0 and finally 2. 3) Use an old deinterlacer, their quality is less good, I always used -vf kerndeint before yadif existed. #ce Local $b_Playback_Started = False While 1 Local $StdoutRead_Buffer = "" Local $StdoutRead_Line = "" Do $StdoutRead_Line = StdoutRead($i_PID_MPlayer) $StdoutRead_Buffer &= $StdoutRead_Line If StringInStr($StdoutRead_Buffer, 'Exiting... (End of file)', 2) Then ConsoleWrite('Exiting... (End of file)' & @CRLF) Exit 3 EndIf If StringLen($StdoutRead_Buffer) > 32768 Then ConsoleWrite("! $StdoutRead_Buffer > 32768 characters" & @CRLF) ; Exit EndIf StringReplace($StdoutRead_Buffer, "Too many buffered pts", "") If @extended > 10 Then ConsoleWrite("! Too many buffered pts" & @CRLF) ; Exit EndIf StringReplace($StdoutRead_Buffer, "Unexpected decoder output", "") If @extended > 10 Then ConsoleWrite("! ERROR - Unexpected decoder output" & @CRLF) Exit 4 EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Until StringInStr($StdoutRead_Buffer, "Starting playback...", 2) Or $b_Playback_Started If $b_Playback_Started = False Then GUIRegisterMsg($WM_EXITSIZEMOVE, "WM_EXITSIZEMOVE") $b_Playback_Started = True StdinWrite($i_PID_MPlayer, "switch_ratio 1" & @LF) ; start MPlayer paused EndIf If $StdoutRead_Buffer Then ConsoleWrite($StdoutRead_Buffer) WEnd Func WM_EXITSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) Local $aSize = WinGetClientSize($hWnd) StdinWrite($i_PID_MPlayer, "switch_ratio " & $aSize[0] / $aSize[1] & @LF) Return $GUI_RUNDEFMSG EndFunc ;==>WM_EXITSIZEMOVE Zedna 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Belini Posted April 26, 2023 Author Share Posted April 26, 2023 (edited) Opening without black stripes was resolved but deactivating deinterlace didn't work, I'm using it to run cdg with a transparent background and in VLC I can deactivate deinterlace and the writing is perfect but in Mplayer it's blurred because it's not deactivating deinterlace. Teste Mplayer: Test VLC: Download test: https://mega.nz/file/YctQAK6b#JYcqP2YwQ-blK8rbwcoIiZnxFjcKRZ4iiXLAmerKhlk Edited April 26, 2023 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
KaFu Posted April 27, 2023 Share Posted April 27, 2023 You're sure it's about deinterlacing? Seems more like an Alpha channel / transparency issue to me. But I couldn't even get the transparency effect for MPlayer shown in your video to work, I only see the text if transparency is > 20 (and this having a large shadow in the screen). What Windows version do you use (I'm using Win10)? Might be related to DWM / Aero. Do you have a reproducer to show the full transparency effect with LibVLC? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Belini Posted April 27, 2023 Author Share Posted April 27, 2023 (edited) Meus testes são no windows 7 e na verdade a transparência deveria ser aplicada na cor 0x000000 que é a verdadeira cor de fundo do cdg mas por algum motivo aqui no windows 7 o fundo reproduzido no mplayer é 0x010001 então se mudar para 0x000000 no seu windows 10 Deve funcionar. no teste com essa libvlc.au3 dá transparência perfeitamente se você aplicar transparência na cor 0x000000 basta baixar o exemplo que postei no primeiro post e incluir comandos para transparência nele, mas como eu disse é possível que se você mudar a cor para 0x000000 haverá transparência no mplayer também. Teste Libvlc.au3: https://mega.nz/file/oZtRmKhY#P_-Emf9I8fW5xyKIW9d--rhgJuT46zzt6RK9_gpEEXo Para remover o desfoque das letras, desmarque essas opções em vlc. Edited April 27, 2023 by Belini My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
KaFu Posted April 27, 2023 Share Posted April 27, 2023 Looks good for me with this code: expandcollapse popup#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <Constants.au3> #include <WinAPI.au3> Global $gui = GUICreate("Test Mplayer", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0x000000) $hWnd_transp = WinGetHandle("Test Mplayer") _WinAPI_SetWindowLong($hWnd_transp, $GWL_EXSTYLE, $WS_EX_LAYERED) _WinAPI_SetLayeredWindowAttributes($hWnd_transp, 0x000000) $pct_W = (@DesktopWidth * 10) / 100 $pct_H = (@DesktopHeight * 10) / 100 $Player = GUICtrlCreateLabel("", ($pct_W / 2), ($pct_H / 2), @DesktopWidth - $pct_W, @DesktopHeight - $pct_H) GUICtrlSetBkColor($Player, 0x000000) Global $hWnd = GUICtrlGetHandle($Player) GUISetState(@SW_SHOW) Global $file, $s_MPlayer_ARGs_WID = " -wid " & Number($hWnd) & " " Global $aSize = WinGetClientSize($hWnd) $file = "100003.cdg" ; lavfi=filtergraph $i_PID_MPlayer = Run("mplayer.exe -vo directx -slave " & $s_MPlayer_ARGs_WID & " -aspect " & $aSize[0] / $aSize[1] & " -identify -noborder −framedrop -priority abovenormal -lavdopts threads=4 -noslices -colorkey 0 " & $file, @ScriptDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) ; StdinWrite($i_PID_MPlayer, "switch_ratio " & $aSize[0] / $aSize[1] & @LF) Local $b_Playback_Started = False HotKeySet("{esc}", "sair") While 1 Local $StdoutRead_Buffer = "" Local $StdoutRead_Line = "" Do $StdoutRead_Line = StdoutRead($i_PID_MPlayer) $StdoutRead_Buffer &= $StdoutRead_Line If StringInStr($StdoutRead_Buffer, 'Exiting... (End of file)', 2) Then ConsoleWrite('Exiting... (End of file)' & @CRLF) Exit 3 EndIf If StringLen($StdoutRead_Buffer) > 32768 Then ConsoleWrite("! $StdoutRead_Buffer > 32768 characters" & @CRLF) ; Exit EndIf StringReplace($StdoutRead_Buffer, "Too many buffered pts", "") If @extended > 10 Then ConsoleWrite("! Too many buffered pts" & @CRLF) ; Exit EndIf StringReplace($StdoutRead_Buffer, "Unexpected decoder output", "") If @extended > 10 Then ConsoleWrite("! ERROR - Unexpected decoder output" & @CRLF) Exit 4 EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Until StringInStr($StdoutRead_Buffer, "Starting playback...", 2) Or $b_Playback_Started $b_Playback_Started = True If $StdoutRead_Buffer Then ConsoleWrite($StdoutRead_Buffer) WEnd Func sair() ProcessClose("Mplayer.exe") Exit EndFunc ;==>sair Belini 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Belini Posted April 27, 2023 Author Share Posted April 27, 2023 All right now @Kafu thank you so much for all the help you've given me. My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
KaFu Posted April 28, 2023 Share Posted April 28, 2023 Nice challenge and glad it worked out for you 🙂👍, OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now