Play sounds with a batch file - file

I want to play a sound or music file with Batch files, but I don't want that Windows show the window from the music player.
So I want to play a sound in the background...
I hope you can help me :D

Here are few scripts.
mediarunner.bat - it uses windows media player active x objects so you cannot used if there's no installed Windows Media Player (though it usually comes packed with the Windows).Accepts only one argument - the path to the file you want to play.
spplayer.bat - uses SP Voice objects but can play only .wav files.Again it accepts as only argument the path to the file you want to play.
soundplayer.bat - uses Internet Explorer objects and specific bgsound tag that can be used only in internet explorer.Can play .mp3,wav,.. files. It can accepts two arguments. The file you want to play and the sound volume (a number between -10000 to 0) :
call soundplayer.bat "C:\Windows\Media\Windows Navigation Start.wav" 0

Related

ffmpeg to batch convert MXF Quicktime files to h264 while retaining 4 track audio (pass thru)

I have a bunch of MXF type files which have Quicktime reference files in a folder with audio components etc.
The encoded .vid file is actually a DV codec. MPEG Streamclip will play the files but won't pass the four audio tracks through. It eaither clips 2 tracks or mixes 4 to 2.
I was hoping that there might be a way to process them from large DV25 files to smaller h264 with audio "keep as same"?
It would be great to batch them perhaps by dropping a shortcut to the Quicktime pointer file.
I can get Apple compressor to do it but I have to use a windows PC.

How to know whether a particular video file (.mp4) is busy or not?

I have a media server application implemented with the help of Wowza (on Linux, Centos). There are some mp4 files stored in my local directory. I am streaming these files whenever any client requests them. At some point in time, all these files need to be deleted from the local directory, through bash/python script. Before deleting, I need to make sure that no client is accessing the video files. How can I know whether a particular video file is getting streamed or not at the present time?
I have tried the following commands, but no luck.
1) fuser xyz.mp4
2) lsof | grep xyz.mp4
Plz, suggest if you know any other alternative.
This is not an OS-platform solution, but rather implements the built-in HTTPProviders in your Wowza software. If you query the following URL:
http://localhost:8086/connectioncounts?flat
It should return an XML output that lists the stream names currently being played. For example:
<WowzaStreamingEngine>
<Stream vhostName="_defaultVHost_" applicationName="vod" appInstanceName="_definst_" streamName="sample.mp4" sessionsFlash="0" sessionsCupertino="3" sessionsSanJose="0" sessionsSmooth="0" sessionsRTSP="0" sessionsMPEGDash="0" sessionsTotal="3"/>
</WowzaStreamingEngine>
The above output shows that sample.mp4 is currently being played. The ?flat option simplifies the output. You would then only need to parse the streamnames.

How do I pass values to an non-command line executable with a batch file?

I have an executable that accepts typed user input on three seperate lines on the GUI. The executable also has a button called "create file" that will perform a file creation based on the typed data. My question is how can I automate passing the three typed values into the executable and then execute the "create file" button all from a batch file? I do not have access to the source code so I cannot make modifications there to achieve this.
(Im not able to write comments yet, so I have to use an "answer")
I agree Cebence, as far as I know you need some kind of macro player. Best free I know of is autohotkey (just google for it). It needs a bit reading in at first but is pretty easy to use and very versatile.
Well, this is not really a batch file solution - I don't think one exists. But you could use a tool like Spy++ to find the IDs of the relevant dialog controls and then write a program to:
Launch the executable
Retrieve the main window handle
Send the appropriate window messages
There is probably software out there that can do this. Maybe there's something that you can batch which will just take the process name or ID and pass a single message to it.
If the GUI application doesn't support command-line arguments BAT file will not be of much help here.
What you actually need is some kind of "GUI macro player" application that will execute a script, i.e. macro like this one:
Switch focus to running application named "XYZ"
Find the input box named "text1" and type in "${param1}"
Find the input box named "text2" and type in "${param2}"
Find the input box named "text3" and type in "${param3}"
Find the button named "button" and click it.
I don't know if there are (free) applications that can do this now, but there was a free application called "Act!" or something like it (its icon was a yellow Mickey Mouse glove with a finger pushing a button). It was actually a ZIP file containing a running Windows executable and Delphi application source code, but I can't find it now on PC Magazine's website.
Hope this helps.

How do i specify to start an application in the specified process?

How to specify to start an application in the specified process in command line.I mean let us take a look at the below command
start "cool.mp3"
it opens the file cool.mp3 in the windows media player but i want it to be opened in the VLC player.How do i mention it?How do i tell to open the file in the VLC player or some other real player.Can we mention the application to run in the specified process ? If so how?
start uses the file associations set by the user. If you want a specific program, then just do so:
"%ProgramFiles%\VideoLAN\VLC\vlc.exe" cool.mp3
Also note that the example you gave can never work with start anyway.

What can i use to automate video snapshots

What command line util can i use to create a thumbnail preview of a video i made? I do not want a single thumb that windows make, i want a large jpg file that has 30 or less shots so i can preview the movie w/o running it.
I either need an app that can do a batch at once or a command line util so i can loop through a folder or w/e i need and feed it to the util. I was thinking of hacking up ffplay to do this, i dont know what i am getting myself into so is that recommended? (i used SDL many times, never its YUV settings nor with ffmpeg)
You can use ffmpeg to perform frame extraction, here's how I've done something similar
ffmpeg -i my_input_video.flv -y -an -sameq -f image2 -r 1 my_frame_%05d.jpg
-i my_input_video.flv specifies the input file
-y overwrite output files
-an disables audio (we're transcoding a video to a series of jpegs, we don't need audio)
-sameq - use same quality as source
-f image2 sets the output format to image2 (an image sequence)
The -r parameter is the frames per second, so the above command will produce one jpeg per second.
Once you have your collection of jpegs, you can use ImageMagick montage command to build a montage image.
You could use MTN. It can scan whole directories and create thumbnails for every video found.
Use mplayer:
mplayer -vo jpeg -frames 1 your_file
Will extract the first frame.
Media Player Classic can make a collection (it's called save as thumbnail; with matrix i.e. 4x4), but only from a single file.
Potplayer can automatically generate the thumbnails for a batch of videos in folders or even in subfolders. It just takes a few clicks.
Add all the videos you want to get thumbnails from to the playlist (You can do this by go to menu "Open-Open Folder...")
Select all the videos in playlist and right click on them.
Select "Create Thumbnail Image(s)..." in pop-up menu.
Custom the output folder, number of Thumbnails, image size and other setting.
Click "OK".

Resources