Hi,
this is my first post here, so sorry if I unintentionally violate the netiquette. I just want to announce a little application I created, in case anyone here has a need for it.
Since I'm too lazy to describe it again, below what I posted on some mailing list about it.
<blockquote>
In the last few days I created a little command-line media player called
"DScmd", based on DirectShow. You can download its first release from here:
https://valentin.dasdeck.com/c/dscmd/
The command-line arguments it currently supports are listed here:
https://valentin.dasdeck.com/c/dscmd/readme.txt
AFAICT there was no such purely DirectShow-based command-line player
yet, which is why I created it. There is e.g. ffplay.exe (which comes
with FFmpeg) which also supports DirectShow, but it has (statically
compiled) 40-60 MB, whereas my dscmd.exe only has 192 kB, since it
doesn't contain any media format/codec parsing code (like libavcodec for
ffmepg/ffplay) at all, but instead only relies on the DirectShow system.
And it also doesn't rely on SDL, but instead uses native Win-API windows
for displaying video in a window.
But it's nevertheless quite powerful, here a couple of features as
unsorted list:
- it allows to build arbitrary DirectShow graphs explicitely
- it allows to load DirectShow filters at runtime, so no registration
(which would require elevated privileges) needed.
- it supports VMR-7, WMR-9 and EVR video renderers (others, like
legacy renderer or Haali only work partially)
- using the LAV (or alternatively FFdshow) filters, it provides the
power of libavcodec etc., so about the same (long) list of supported
container formats and media codecs as ffplay/ffmpeg.
- SHOUTcast/Icecast audio and HLS video streaming support (via LAV
Splitter Source)
- Video/audio capturing support (playback or recording e.g. to AVI)
- interactive keyboard control (optional, via "-i")
Check out/run the demo batch scripts in folder "demos". Most of them
should run in any recent Windows (e.g. Win 8.x/Win 10.x, 32/64-bit).
Only 3 of them - demo_file_video.bat, demo_file_fullscreen.bat and
demo_url_video.bat - are meant to demonstrate direct video playback
without creating an explicit filter graph, and therefor rely on
appropriate filters registered in the system. If those 3 demos don't
work for you, you can execute "__register_run_as_admin.bat" in folder
"demos/filters" - by running it as admin, as the name suggests - to
register the provided LAV filters, then also those should work.
Final note: in interactive mode (-i), you can switch (toggle) any loaded
video to fullscreen by typing "f" after the video was loaded. But the
commandline argument "-fullscreen" is meant for situations when only
strict fullscreen playback is required and never the desktop should be
shown. Therefor this mode doesn't allow to switch back to non-fullscreen
mode, and therefor also not to quit the player by closing the video
window via close button in its title bar. To quit a player running in
this explicit fullscreen mode, in interactive mode just type "q" or ESC,
otherwise shortcut Alt-F4 always works.
</blockquote>
+ Reply to Thread
Results 1 to 8 of 8
-
-
Trying this program but can't understand how to get a video to playback?
Does this look right?
dscmd -graph {B98D13E7-55DB-4385-A33D-09FD1BA26338};src=C:\Users\Trsula\palemoondownload s\dscmd-v0.4-x64\latest-x64\src=bbb_360p_10sec.mp4;{EE30215D-164F-4A92-A4EB-9D4C13390F9F},{04FE9017-F873-410E-871E-AB91661A4EF7},{51B4ABF3-748F-4E3B-A276-C828330E926A},{E8E73B6B-4CB3-44A4-BE99-4F7BCB96E491},{79376820-07D0-11CF-A24D-0020AFD79767}, -i -v=3 -progress -
Hi, since you try to use some custom filter (BASS) that I don't have, I can't debug this. But in general, if you use custom filters it's unlikely that the system can render them automatically, therefor you have to provide an explicit filter connection list, which you omited in the code you posted.
For creating a new DSCmd command line that actually works, I recommend to use my GraphStudioNext-Enhanced tool. Download and run the x64 release version, then build a graph that actually works when you press the green "play" button, and then finally select "Generate Code..." from the "File" menu and save the current graph as batch script for DSCmd. If you save it into the same folder as "dscmd.exe", the batch script should work out of the box, otherwise you either have to put the folder of dscmd.exe into the PATH environment variable or edit the batch script in a text editor and replace "DScmd.exe" with its absolute path. so e.g. "C:\Users\Trsula\palemoondownloads\dscmd-v0.4-x64\latest-x64\DScmd.exe".
Attached screenshot shows the process.
[Attachment 90082 - Click to enlarge]Last edited by fluxus; 4th Dec 2025 at 08:44.
-
ps: since you mentioned "can't understand", here a quick explanation: DirectShow is based on graphs, i.e. filters connected in a specific way with each other. In graph theory (math) the elements of such a graph are called vertices (here: the filters) and edges (here: which filter should be connected with which other one(s)).
To allow describing such a graph completely in a linear string passed as parameter "-graph" to dscmd, I came up with the following solution:
- First list all the filters that your graph uses (as CLSIDs, separated by ";")
- Then second, separated from the filter list by a "!", list all the edges. Each edge is represented by <from>:<to>, where from and to are the indexes in the filter list above and index counting starts at 0. So e.g. "0:2" means "connect the first and the third filter in the list above", and "0:1,1:2,1:3" means "connect the first and second, and also the second and third, and also the second and forth filter in the list above".
I hope this helps to understand how the tool works. -
Hi, I downloaded and used your GraphStudioNext-Enhanced tool. Made a working graph and generated the .bat file.
Put the .bat file in the same folder as dscmd.exe but it didn't work. Example below:
I actually wanted to have a completed cmdline so after looking at the .bat file and your readme file I have a couple of working cmdline examples:Code:::-------------------------------------- :: GraphStudioNext code export for DScmd ::-------------------------------------- @echo off chcp 65001>nul set CLSID_FileSourceAsync={E436EBB5-524F-11CE-9F53-0020AF0BA770} set CLSID_LAVSplitter={171252A0-8820-4AFE-9DF8-5C92B2D66B04} set CLSID_ffdshowVideoDecoder={04FE9017-F873-410E-871E-AB91661A4EF7} set CLSID_avisynthfilterax={E5E2C1A6-C90F-4247-8BF5-604FB180A932} set CLSID_HopperRenderdll={8B498501-1218-11CF-ADC4-00A0D100041B} set CLSID_VideoMixingRenderer={51B4ABF3-748F-4E3B-A276-C828330E926A} DScmd.exe ^ -graph ^ %CLSID_FileSourceAsync%;src=C:\Volumes\vlc.avs\vlc.avi,^ %CLSID_LAVSplitter%,^ %CLSID_ffdshowVideoDecoder%,^ %CLSID_avisynthfilterax%,^ %CLSID_HopperRenderdll%,^ %CLSID_VideoMixingRenderer%^ !0:1,1:2,2:3,3:4,4:5 ^ -winCaption "GraphStudioNext Export" ^ -i echo. pause
Code:dscmd -graph {E436EBB5-524F-11CE-9F53-0020AF0BA770};src=C:\Volumes\vlc.avs\vlc.avi,{171252A0-8820-4AFE-9DF8-5C92B2D66B04},{04FE9017-F873-410E-871E-AB91661A4EF7},{E5E2C1A6-C90F-4247-8BF5-604FB180A932};file=filters\avisynth_filter_64.ax,{8B498501-1218-11CF-ADC4-00A0D100041B};file=filters\HopperRender.dll,{51B4ABF3-748F-4E3B-A276-C828330E926A},!0:1,1:2,2:3,3:4,4:5 -i -v=3 -progress -size 1920,1080Sorry I meant I didn't understand how to construct a working cmdline for your program.Code:dscmd -graph {E436EBB5-524F-11CE-9F53-0020AF0BA770};src=C:\Users\Trsula\palemoondownloads\test1\dscmd-v0.4-x64\latest-x64\HDPVR_20190422_1914.m2ts,{171252A0-8820-4AFE-9DF8-5C92B2D66B04},{04FE9017-F873-410E-871E-AB91661A4EF7},{E5E2C1A6-C90F-4247-8BF5-604FB180A932};file=filters\avisynth_filter_64.ax,{8B498501-1218-11CF-ADC4-00A0D100041B};file=filters\HopperRender.dll,{51B4ABF3-748F-4E3B-A276-C828330E926A},!0:1,1:2,2:3,3:4,4:5 -i -v=3 -progress -size 1920,1080
Thanks for the examples.
A few other questions:
I tried the option: "-saveGrf <filename>" and the option "-register" but the graph loaded wasn't complete? And I couldn't find where "-register" puts the saved graph?
Also how do I turn off the "use clock" feature from GraphStudioNext in the bat file or cmdline?Last edited by Milardo; 4th Dec 2025 at 21:56.
-
Yes, I forgot to mention that this "Generate Code..." feature only works with filters that are properly registered in the system, not with filters that are loaded from DLL at runtime. But this "HopperRender" is special, it seems that it can only be loaded from DLL, even when registered it never shows up in the system's filter list. Therefor you have to add the path to its DLL manually to the output of "Generate Code...".
If you append "-saveGrf foo.grf" to the end of your command line, DScmd will save the graph it uses - if it could successfully build a graph at all - as binary .grf file "foo.grf" in the current working directory. But loading this .grf file into GraphStudio/GraphStudioNext will again only work if all its filters are properly registered in the system, not loaded from DLL.
Concerning "-register", this is mainly useful for (visual) debugging. All versions of GraphStudio/GraphStudioNext have an item called "Connect to Remote Graph..." in their "File" menu. If you play a graph with DScmd and added "-register", DScmd's current graph will show up under "Connect to Remote Graph..." and GraphStudio/GraphStudioNext can connect to it and display it. Players like MPC-HC/MPC-BE always register their current graphs in the system, DScmd only on request. But yet again, connecting to a remote graph only works with properly registered filters, so not with HopperRender.
You can turn off clock usage by parameter "-noClock", as stated in readme.txt.Last edited by fluxus; 5th Dec 2025 at 07:07.
-
Ok.
Another question is how does one add a video capture source like in the screenshot below? I tried to add to cmdline and got the below:
It works in graphstudionext-enhanced.Code:C:\Users\Trsula\palemoondownloads\test1\dscmd-v0.4-x64\latest-x64>dscmd -graph {17CCA71B-ECD7-11D0-B908-00A0C9223196},{04FE9017-F873-410E-871E-AB91661A4EF7},{E5E2C1A6-C90F-4247-8BF5-604FB180A932};file=filters\avisynth_filter_64.ax,{FA10746C-9B63-4B6C-BC49-FC300EA5F256},!0:1,1:2,2:3 -i -v=3 -progress -size 1920,1080 -noClock Starting DirectShow graph... Adding filter {17CCA71B_ECD7_11D0_B908_00A0C9223196} Adding filter {04FE9017_F873_410E_871E_AB91661A4EF7} Adding filter {E5E2C1A6_C90F_4247_8BF5_604FB180A932} Adding filter {FA10746C_9B63_4B6C_BC49_FC300EA5F256} Connecting filters: 0 -> 1 Error: Connecting filters failed - VFW_E_CANNOT_CONNECT - No combination of intermediate filters could be found to make the connection. Error: Loading graph failed - VFW_E_CANNOT_CONNECT - No combination of intermediate filters could be found to make the connection. -
DirectShow Video Capture Source filters are no problem, see attached example based on source filter SpoutCam. The exported batch script works perfectly fine with DScmd.
The problem is that your video capture source is not really a DirectShow filter, but a WDM driver wrapped with "Generic WDM Filter Proxy", as shown by the orange color in GraphStudioNext. This generic proxy needs additional config data to know which WDM driver to use etc., and unfortunately DScmd doesn't allow to provide this data. The only way to use it would be to save your graph as .grf file, and then play this .grf file with DScmd, that should work fine.
[Attachment 90144 - Click to enlarge]Last edited by fluxus; 8th Dec 2025 at 15:09.
Similar Threads
-
Are there any programmer,who can create vfw/directshow based X265 encoder?
By Stears555 in forum Video ConversionReplies: 77Last Post: 30th Jun 2018, 03:30 -
Can't get Avidemux command line options to work on Windows 7
By countytime in forum Newbie / General discussionsReplies: 13Last Post: 8th Apr 2018, 15:53 -
How to multiplex avi files on linux/mac/windows? (command line)
By Selur in forum Newbie / General discussionsReplies: 4Last Post: 27th Jan 2018, 09:30 -
windows batch: paste but don't execute command in Windows command prompt
By flashandpan007 in forum ProgrammingReplies: 17Last Post: 23rd Jun 2016, 00:12 -
Is There Any Command Line Tools For Editing The Image-Based Subtitles?
By MounaLafi in forum SubtitleReplies: 1Last Post: 18th Jan 2015, 12:10


Quote
