Lirk Posted December 16, 2024 Posted December 16, 2024 SMPlayer with MPV engine for XP (last version - mpv-i686-20151029, with opengl-old support - mpv-i686-20150120) works now with XP versions of youtube-dl and renamed yt-dlp.exe to youtube-dl.exe natively. But the main problem is bad support of the output video modules in this engine, it doesn't support DirectX module, only Direct3D, in my case I can get playback only with frame dropping issues, in other cases, such as older videocards it even doesn't run and will give error about not supporting. The main it advantage is natively supporting DASH streams. Without DASH for now playback is available only in 360p and it can be used with batch script, look like this: @echo off :BEGIN set /p LINK=YOUTUBE LINK: for /F "delims=" %%a in ('youtube-dl -g -f "best[height<=720][height>360][vcodec^=avc1]/best[height<=720][vcodec^=avc1]" "%LINK%"') do set "VIDEOLINK=%%~a" "%programfiles%\SMPlayer\smplayer" "%VIDEOLINK%" goto :BEGIN SMPlayer doesn't support passing of the MPlayer parameters from Command Line, so DASH support I have only in MPlayer without GUI, which is less convenient: @echo off :BEGIN set /p LINK=YOUTUBE LINK: for /F "delims=" %%a in ('youtube-dl -g -f "bestvideo[ext=mp4][height<=720][fps<=30][vcodec^=avc]" "%LINK%"') do set "VIDEOLINK=%%~a" for /F "delims=" %%a in ('youtube-dl -g -f "bestaudio[ext=m4a][acodec^=mp4a]" "%LINK%"') do set "AUDIOLINK=%%~a" "%programfiles%\SMPlayer\mplayer\mplayer" -aspect 4:3 -xy 800 -vo directx -ao dsound "%VIDEOLINK%" -audiofile "%AUDIOLINK%" goto :BEGIN Is there GUI frontend for MPlayer, which support passing of the MPlayer parameters in CLI? Or maybe this could be implemented differently? Would better to use some GUI for pasting links instead CLI.
Zorba the Geek Posted January 18 Posted January 18 I am glad that you have raised this issue because I have been struggling to pipe DASH streams to MPC-HC using the latest youtube-dl and yt-dlp from the commandline. When I have time I will give your batch scripts a try. Do you realize that MPV 0.35 has been backported to XP by Maroc at MDL?
Lirk Posted January 19 Author Posted January 19 11 hours ago, Zorba the Geek said: Do you realize that MPV 0.35 has been backported to XP by Maroc at MDL? For old hardware this is a worse solution, than using old version of MPV. But even old MPV version works worse, than MPlayer with DirectX module.
user57 Posted January 22 Posted January 22 (edited) the problem with directx is that we dont have dx10/11 or 12 for xp directx10/11/12 is a closed source so we cant see into that engine, so it might end up in a stuckpoint (if you put it the right way "it ask for dx10/11/12") but maybe directx or opengl is even the wrong answer from what i seen in the code its not opengl or directx doing the job its the CUDA engine that gives the RGB buffer to the opengl or directx engine so we might put it the right way you dont need a grafic card to encode / or decode an image or video (the HEIC en/decoder from msfn is proof of that) CUDA is a engine for a grafic card, it makes control/input/output as engine directx/open - uncertain for now - but from what i think its just a engine that gets the data from CUDA if we might think that "software mode" is to slow, no not this time because mmx-avx are from the same nature they 10-500 times faster then normal opcodes thats more then enough to make it fast enough this time so what does CUDA do ? cuda controls a grafic card unit that can make en/decoding of common video formats that sounds good so far - because if you want have something done you want a hardware unit to do the job but nowdays we have many cores - what also can be seen as a hardware unit (that is programmable) while a pure hardware unit is like a print - once printed it cant be changed but the formats are being upgraded - for example CUDA cant en/decode the h.266 codec the grafic card doing the encoding is kinda new, its not like a video game what hardware accelation is from like 1995 or something the video card doing that for a video en/decoder job is not to long ago, and many modes are not supported either the CUDA engine itself is not well supported for windows xp so going that direction might just lead to windows 10 then there you have the right grafic card driver, the right cuda engine, and dx12 so you dont have to deal with any other questions then again, i pointed this out in a other post for a nativ solution we would have insight to the nvidia driver what actually controls the grafic card then we would have a OS-independent solution (high level functions) i dont see this at the moment like at all. when the problems already where spinning around in a LAV engine that makes 3 engines - and no grafic card control was touched at all so at the moment its spinning around in these 3 engines - not where the needs actually would rely a strongpoint could actually be that directx9 dont look that much different to dx10/11/12 so it might could be given a RGB buffer from the CUDA engine - but the CUDA engine for XP is not being upgraded by nvidia https://youtu.be/W3zfb8lLDH0 https://youtu.be/p8387-gu37s https://www.youtube.com/watch?v=mZ-0XBqRxuc the problem i see is that already a next engine came but here is the problem : DX11->CUDA->GRAFIC-CARD-High-FLevel-Functions OPENGL->CUDA->GRAFIC-CARD-High-Level-Functions this time: MPV engine->CUDA->GRAFIC-CARD-High-Level-Functions so everybody can see the problem the high level functions are not touched (neither is CUDA) (MPV calls up cuda ? no ...) we had to sort out a similiar question, at first it was like "you need a grafic card doing this job" it took a while until everybody had an agreement that this is not the case - also not for speed (software mode) basicly this only leaves the software option, in avx ect. its by far enough of speed this is not done by a engine like directx, cuda or video card high levels functions its like the RAW control of the RGB buffer for a video player doing the decoding maybe encoding if wanted Edited January 22 by user57 1
Lirk Posted January 29 Author Posted January 29 On 1/22/2025 at 3:50 PM, user57 said: the problem with directx is that we dont have dx10/11 or 12 for xp And what? DirectX engine is needing only for supporting old graphics card and CUDA was introduced in 2007, which is more compatible with Vista/7.
user57 Posted January 30 Posted January 30 its one thing to print a RGB buffer to a screen, that is what directx video is doing what i wanted to point out is first that CUDA is doing the de/encoding (so basicly everything 99.99 % happens in CUDA, not in directx) then second is some parameters are different in directx versions, the example code already needed d3d9ex not d3d9 without the ex so it also could be that some parameters are just not supported in dx9, hard to say exactly thats why you can give that "RGB" buffer to opengl instead to directx that strongly speaks for windows xp´s directx9, however cuda if you want to do that with a grafic card is doing the important thing the RGB buffer we also could draw with a GDI engine - and thats why i said directx might not be the right question another point is that cuda can be done software wise with mmx-avx (so called XMM registers), those are very fast and by far enough for the purpose either en or decoding rather cuda is a hardware interpretation of a software .... thats it if it has to be a card, why not someone invent a PCI-E card doing the en/decoding ? we do not neccesary need a grafic card to do so - maybe a new hardware invention ? that with the high level functions is different to ask if you have paint - paint isnt making the drawing - it use GDI and GDI use NTGDI and NTGDI use internal functions what in the end go into the grafic card driver using a next engine would be a script that controls paint - that you see quite often that "pre CUDA" is a DLL , it probaly has a pre code for the real control to the cuda part in the grafic card - while cuda is being coded in a CUDA SDK - what is also some "scriptish code" to control the CUDA engine (and is like totally bond to dx10/11 and windows10/11) , the phyton version also only control cuda so hard to say what to call this ? a half-script language to control cuda ? a engine code to control cuda ? a simplified programming to control cuda ? i dont know what i would name it, maybe the others have some corrections for me and im happy to hear them why we have to be so indirectly ? why cant we just use cuda rather directly ?
Lirk Posted February 1 Author Posted February 1 On 1/30/2025 at 6:54 PM, user57 said: its one thing to print a RGB buffer to a screen, that is what directx video is doing what i wanted to point out is first that CUDA is doing the de/encoding (so basicly everything 99.99 % happens in CUDA, not in directx) then second is some parameters are different in directx versions, the example code already needed d3d9ex not d3d9 without the ex so it also could be that some parameters are just not supported in dx9, hard to say exactly thats why you can give that "RGB" buffer to opengl instead to directx that strongly speaks for windows xp´s directx9, however cuda if you want to do that with a grafic card is doing the important thing the RGB buffer we also could draw with a GDI engine - and thats why i said directx might not be the right question another point is that cuda can be done software wise with mmx-avx (so called XMM registers), those are very fast and by far enough for the purpose either en or decoding rather cuda is a hardware interpretation of a software .... thats it if it has to be a card, why not someone invent a PCI-E card doing the en/decoding ? we do not neccesary need a grafic card to do so - maybe a new hardware invention ? that with the high level functions is different to ask if you have paint - paint isnt making the drawing - it use GDI and GDI use NTGDI and NTGDI use internal functions what in the end go into the grafic card driver using a next engine would be a script that controls paint - that you see quite often that "pre CUDA" is a DLL , it probaly has a pre code for the real control to the cuda part in the grafic card - while cuda is being coded in a CUDA SDK - what is also some "scriptish code" to control the CUDA engine (and is like totally bond to dx10/11 and windows10/11) , the phyton version also only control cuda so hard to say what to call this ? a half-script language to control cuda ? a engine code to control cuda ? a simplified programming to control cuda ? i dont know what i would name it, maybe the others have some corrections for me and im happy to hear them why we have to be so indirectly ? why cant we just use cuda rather directly ? This topic not about CUDA advantages over DirectX. It about using an old hardware with the most compatible output video modules. 1
Reino Posted March 29 Posted March 29 On 12/16/2024 at 8:30 PM, Lirk said: @echo off :BEGIN set /p LINK=YOUTUBE LINK: for /F "delims=" %%a in ('youtube-dl -g -f "bestvideo[ext=mp4][height<=720][fps<=30][vcodec^=avc]" "%LINK%"') do set "VIDEOLINK=%%~a" for /F "delims=" %%a in ('youtube-dl -g -f "bestaudio[ext=m4a][acodec^=mp4a]" "%LINK%"') do set "AUDIOLINK=%%~a" "%programfiles%\SMPlayer\mplayer\mplayer" -aspect 4:3 -xy 800 -vo directx -ao dsound "%VIDEOLINK%" -audiofile "%AUDIOLINK%" goto :BEGIN You don't have to call youtube-dl twice. There are more efficient ways to go about this. Pure Batch @ECHO off :BEGIN SETLOCAL SET /P LINK=YOUTUBE LINK: IF NOT DEFINED LINK GOTO :EOF FOR /F "delims=" %%A IN (' youtube-dl -gf "bestvideo[ext=mp4][height<=720][fps<=30][vcodec^=avc]+bestaudio[ext=m4a][acodec^=mp4a]" "%LINK%" ') DO (IF NOT DEFINED VIDEOLINK (SET "VIDEOLINK=%%A") ELSE (SET "AUDIOLINK=%%A")) "%programfiles%\SMPlayer\mplayer\mplayer" -aspect 4:3 -xy 800 -vo directx -ao dsound "%VIDEOLINK%" -audiofile "%AUDIOLINK%" ENDLOCAL GOTO :BEGIN If you want the script to go in a loop with GOTO, then I suggest you use SETLOCAL and ENDLOCAL to reset all variables each loop and GOTO :EOF as an escape (to simply press <enter> to stop the script). Xidel (variable export) Xidel is an XML/HTML/JSON-parser and an extremely versatile command line tool. The latest recommended dev-builds can be found here, here, or on my own host. @ECHO off :BEGIN SETLOCAL SET /P LINK=YOUTUBE LINK: IF NOT DEFINED LINK GOTO :EOF FOR /F "delims=" %%A IN (' youtube-dl -gf "bestvideo[ext=mp4][height<=720][fps<=30][vcodec^=avc]+bestaudio[ext=m4a][acodec^=mp4a]" "%LINK%" ^| xidel -se "url:=x:lines($raw)" --output-format^=cmd ') DO %%A "%programfiles%\SMPlayer\mplayer\mplayer" -aspect 4:3 -xy 800 -vo directx -ao dsound %url[0]% -audiofile %url[1]% ENDLOCAL GOTO :BEGIN %url[0]% and %url[1]% shouldn't be quoted, because Xidel already escapes the "&" and "=". Xidel (generate string to execute) You don't need a Batch-script. You can simply enter the following (prettified) one-liner in CMD. Xidel generates the string, which the FOR-loop then executes. FOR /F "delims=" %A IN (' youtube-dl -gf "bestvideo[ext=mp4][height<=720][fps<=30][vcodec^=avc]+bestaudio[ext=m4a][acodec^=mp4a]" "<url>" ^| xidel -se "let $url:=x:lines($raw) return `\"%programfiles%\\SMPlayer\\mplayer\\mplayer\" -aspect 4:3 -xy 800 -vo directx -ao dsound \"{$url[1]}\" -audiofile \"{$url[2]}\"`" ') DO @%A Xidel (parse the JSON and generate string to execute) As Xidel is a JSON-parser, you can also let youtube-dl spit out all the info as JSON and let Xidel select the formats. Unfortunately all the necessary characters between the escaped double-quotes ( \" ) need to be escaped for CMD. FOR /F "delims=" %A IN (' youtube-dl -j "<url>" ^| xidel -se "`\"%programfiles%\\SMPlayer\\mplayer\\mplayer\" -aspect 4:3 -xy 800 -vo directx -ao dsound \"{$json/^(formats^)^(^)[ext^='mp4' and height le 720 and fps le 30 and starts-with^(vcodec^,'avc'^)][last^(^)]/url}\" -audiofile \"{$json/^(formats^)^(^)[audio_ext^='m4a' and starts-with^(acodec^,'mp4a'^)][last^(^)]/url}\"`" ') DO @%A
Lirk Posted April 9 Author Posted April 9 On 3/29/2025 at 6:28 PM, Reino said: You don't have to call youtube-dl twice. There are more efficient ways to go about this.If you want the script to go in a loop with GOTO, then I suggest you use SETLOCAL and ENDLOCAL to reset all variables each loop and GOTO :EOF as an escape (to simply press <enter> to stop the script). Yes, I fixed this (also, found your post on dostips.com about this). But this was not the main problem for me. Maybe you know, how to use two streams in one file, because using "-audiofile" parameter is not suitable for other players, than mplayer. What are the possible options?- Using temporary m3u8 file or something else?
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now