Belini Posted December 21, 2019 Share Posted December 21, 2019 Does anyone know what I should use in mciSendString for video to occupy every area of the screen without having black stripes on top, bottom or sides? 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...
TheXman Posted December 21, 2019 Share Posted December 21, 2019 (edited) I'm not sure how your question is relevant to AutoIt, but have you tried the "stretch" flag of the Window command? Edited December 21, 2019 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Belini Posted December 22, 2019 Author Share Posted December 22, 2019 @TheXman I tried in some ways but none worked. _mciSendString("play " & $sAlias & "window stretch") _mciSendString("play " & $sAlias & " stretch") _mciSendString("window " & $sAlias & " stretch") _mciSendString($sAlias & "window stretch") _mciSendString($sAlias & " stretch") 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 December 23, 2019 Author Share Posted December 23, 2019 I found the code made in VB but it didn't work with Autoit. ' Videobild stretchen Public Sub mciSetVideoStretch() On Error Resume Next mciSendString "window TempMCI stretch", 0, 0, 0 End Sub _mciSendString("window " & $sAlias & " stretch"); Autoit 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...
CYCho Posted May 31, 2023 Share Posted May 31, 2023 @Belini, Have you come up with a solution? In my experience, most of the files would stretch to whatever size I give with WinMove() function after I obtain a popup style video window. But there are some files, especially of movies, that persistently keep the original aspect ratios and fill up the blank spaces with black strips. It may have something to do with codecs. For your information, I use K-Lite codecs. If you have found a solution, would you mind sharing your solution? Thanks in advance. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Belini Posted May 31, 2023 Author Share Posted May 31, 2023 unfortunately not and I'm trying to use a player that already has this option and that also doesn't need to install codecs to work, what seemed like it would work better was libvlc but I had problems incorporating its window into an Autoit gui, if I can get one that works well I'll give you the tip. 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...
CYCho Posted November 28, 2023 Share Posted November 28, 2023 (edited) I implemented fullscreen function with winmm.dll in my zPlayer and the following is a replication of that function. expandcollapse popup#include <GUIConstants.au3> HotKeySet("{F11}", "_FullScreen") Global $videoWidth = @DesktopWidth/3*2, $videoHeight = $videoWidth*9/16, $iGui, $iFullScreen $hVideoGUI = GUICreate("WINMM.DLL", $videoWidth, $videoHeight) $iGui = Dec(StringMid($hVideoGUI, 3)) GUISetState(@SW_HIDE, $hVideoGUI) $aPos = WinGetPos($hVideoGUI) $borderWidth = ($aPos[2]-$videoWidth)/2 $titleHeight = $aPos[3]-$videoHeight-$borderWidth GUISetState() $sFile = "D:\Video\Voorbeeld.mp4" GUIRegisterMsg($WM_MOVE, "WM_MOVE") $hDLL = DllOpen("winmm.dll") mciSendString("open """ & $sFile & """ alias myMedia type MPEGVideo style popup parent " & $iGui) $hVideo = WinGetHandle($sFile) WinMove($hVideo, "", $aPos[0]+$borderWidth, $aPos[1]+$titleHeight, $videoWidth, $videoHeight) mciSendString("play myMedia") While 1 Switch GUIGetMsg(0) Case $GUI_EVENT_CLOSE mciSendString("close myMedia") DllClose($hDLL) Exit EndSwitch If mciSendString("status myMedia mode") = "stopped" Then mciSendString("play myMedia from 0") EndIf WEnd Func mciSendString($string) Local $aRet = DllCall($hDLL, "int", "mciSendStringW", "wstr", $string, "wstr", "", "int", 65534, "hwnd", 0) If Not @error Then Return $aRet[2] EndFunc ;==>mciSendString Func _FullScreen() If WinGetState($hVideo) < 7 Then Return WinActivate($hVideoGUI) If $iFullScreen = 0 Then $aPos = WinGetPos($hVideoGUI) $iFullScreen = 1 WinMove($hVideo, "", 0, 0, @DesktopWidth, @DesktopHeight) Else $iFullScreen = 0 WinMove($hVideo, "", $aPos[0]+$borderWidth, $aPos[1]+$titleHeight, $videoWidth, $videoHeight) EndIf EndFunc Func WM_MOVE($hWnd, $MsgID, $wParam, $lParam) #forceref $hWnd, $MsgID, $wParam, $lParam If $hWnd <> $hVideoGUI Then Return $GUI_RUNDEFMSG If $iFullScreen = 1 Then Return $GUI_RUNDEFMSG $aPos = WinGetPos($hVideoGUI) Local $x1, $y1, $w1, $h1 $x1 = $aPos[0]+$borderWidth $y1 = $aPos[1]+$titleHeight $w1 = $aPos[2]-$borderWidth*2 $h1 = $aPos[3]-$titleHeight-$borderWidth WinMove($hVideo, "", $x1, $y1, $w1, $h1) Return $GUI_RUNDEFMSG EndFunc Edited November 28, 2023 by CYCho Zedna 1 zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Belini Posted December 3, 2023 Author Share Posted December 3, 2023 (edited) Thanks @CYCho I'll test it here to see if it works on mine too EDITED: I tested it here and it doesn't work, your script only maximizes the window but doesn't make the video fill the entire screen and it still has black stripes when the video isn't the same resolution as the desktop Edited December 3, 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...
CYCho Posted December 3, 2023 Share Posted December 3, 2023 (edited) 2 hours ago, Belini said: I tested it here and it doesn't work I tested the above code in Windows 10 and 11 and it works as intended in both of the systems. What system are you on? in my zPlayer, I intentionally forced the screen to maintain the original source aspect ratio, but the above code is supposed to fill the entire screen regardless of the aspect ratio if F11 hotkey is pressed while a video is playing. Edited December 3, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Belini Posted December 4, 2023 Author Share Posted December 4, 2023 I tested it on Windows 7 and it gets black stripes on the sides if the video resolution is not equal or proportional to the desktop resolution. 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...
CYCho Posted December 4, 2023 Share Posted December 4, 2023 (edited) Looking at your image, it seems to me that the source image itself has black stripes. If it does, the black stripes will appear even if you don't make it a fullscreen, because they are a part of the image. Edited December 5, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Nine Posted December 4, 2023 Share Posted December 4, 2023 How do you take a picture with 2 black stripes on the side ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
CYCho Posted December 4, 2023 Share Posted December 4, 2023 (edited) On 12/5/2023 at 8:09 AM, Nine said: How do you take a picture with 2 black stripes on the side ? I have a movie file which has black stripes on the top and bottom. I don't think the movie itself was shot with black stripes. The file I have might be a screen capture. Below is the image showing how it looks when played in Windows Media Player. Edit: https://www.anymp4.com/video-editing/remove-black-bars-from-video.html Edited December 5, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Belini Posted December 7, 2023 Author Share Posted December 7, 2023 (edited) @CYCho this is how the 1024 x 786 video is shown in a resolution of 1600 x 900 using wimm.dll but there are players that have the option to stretch to fill the entire screen without getting those black stripes on the sides or top and lower, for example winamp and vlc. Edited December 7, 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...
CYCho Posted December 7, 2023 Share Posted December 7, 2023 (edited) @Belini, the file I mentioned above is a 1920 x 1080 video and my desktop resolution is also 1920 x 1080. When I stretch this video to fullscreen in winmm.dll or vlc, I see the black stripes on top and bottom. I know that winmm.dll has no function to truncate the black stripes. I would like to see how vlc does it, but I am not so familiar with vlc. Could you let me know what options I should change in vlc to truncate the black stripes? Edited December 8, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Belini Posted December 8, 2023 Author Share Posted December 8, 2023 (edited) To get a full screen in VLC you will first need to find out the aspect ratio of your desktop and send it to VLC via the command line when you open it, and I created a function to find out the aspect ratio of the desktop. expandcollapse popupGlobal $oHttpObj = ObjCreate("winhttp.winhttprequest.5.1"); cria a janela do navegador para receber os comandos $ratio_maq = Preenche_Tela(@DesktopWidth, @DesktopHeight); pega o aspect ratio da tela $pid_vlc = Run('"' & @ScriptDir & '\vlc.exe"' & " --aspect-ratio=" & $ratio_maq & " --video-title=Video:9999 --fullscreen --video-x=1 --video-y=1 -Idummy --extraint=http --http-host=127.0.0.1 --http-port=9999 --http-password=0000", @ScriptDir, @SW_HIDE); executa o vlc _Video_play(@ScriptDir & '\Produce.mp4'); toca o vídeo escolhido em tela cheia Func Preenche_Tela($resol_w, $resol_h) Local $GCD, $ASP_RAT, $GUARD, $INT[3] $INT[1] = $resol_w $INT[2] = $resol_h For $i = $INT[1] To 1 Step -1 If Mod($INT[1], $i) = 0 Then $GUARD &= "|" & $i & "|" Next For $i = $INT[2] To 1 Step -1 If Mod($INT[2], $i) = 0 Then If StringInStr($GUARD, "|" & $i & "|") Then $GCD = $i ExitLoop EndIf EndIf Next $ASP_RAT = ($INT[1] / $GCD) & ":" & ($INT[2] / $GCD) Return $ASP_RAT EndFunc ;==>Preenche_Tela Func _Video_play($video = "") Local $comando = "http://127.0.0.1:9999/requests/status.xml?command=in_enqueue&input=" & $video; coloca o arquivo na lista $oHttpObj.open("GET", $comando, False) $oHttpObj.SetRequestHeader("Authorization", "Basic OjAwMDA=0000") $oHttpObj.Send(); executa o vlc identificando a janela $comando = "http://127.0.0.1:9999/requests/status.xml?command=pl_play" $oHttpObj.open("GET", $comando, False) $oHttpObj.SetRequestHeader("Authorization", "Basic OjAwMDA=0000") $oHttpObj.Send() WinWait("Video:9999", "", 5) WinSetOnTop("Video:9999", "", 1) EndFunc ;==>_Video_play Edited December 9, 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...
CYCho Posted December 8, 2023 Share Posted December 8, 2023 (edited) Thanks for your code. I played my file with your code, but I still see the black stripes. Edited December 8, 2023 by CYCho zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment Link to comment Share on other sites More sharing options...
Belini Posted December 9, 2023 Author Share Posted December 9, 2023 (edited) So your video was already made with black stripes, send me the video so I can check it out here. Edited December 9, 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...
CYCho Posted December 9, 2023 Share Posted December 9, 2023 45 minutes ago, Belini said: send me the video so I can check it out here The file is too big (17.7 GB). I will find a way to cut a short portion of the file so that I can send you. zPlayer - A Small Audio and Video Player Time Sync + SystemTimeAdjustment 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