Guys,
I need to run a video file through command prompt enabling "repeat"...
Could some one please help me.. ASAP
Thanks in Advance!!
How to play video file repeatedly using command prompt
Moderator: DosItHelp
Re: How to play video file repeatedly using command prompt
What do you mean by "repeat"?
Enable "repeat" feature from media player OR play the video file again when the media is closed?
Enable "repeat" feature from media player OR play the video file again when the media is closed?
Re: How to play video file repeatedly using command prompt
Thanks for the quick response Fawers!!
Basically, to Enable "repeat" from media player. But both sounds similar..
I have a different script which executes for more than 30mins, where i need to run video content on background in parallel which is 2min long.. So , i need to repeat the content untill script
ends
Basically, to Enable "repeat" from media player. But both sounds similar..
I have a different script which executes for more than 30mins, where i need to run video content on background in parallel which is 2min long.. So , i need to repeat the content untill script
ends
Re: How to play video file repeatedly using command prompt
I see.
I don't think it's possible, but can one activate "repeat" in this media player with command line parameters? I can't think of other way to enable it via batch.
Everything below this line must be read assuming you can't enable "repeat" with CL parameters.
By the way, let's assume 3 other things:
1. You're using media player classic (executable name: "mpc hc.exe")
2. The video file is in the same folder as mpc hc.exe and its name is "video file.avi"
3. The batch script is in the same folder as mpc hc.exe
You said the video has 2 minutes; we can do something like this:
Let's call this script "play_video.bat".
And you would probably have to start it from another batch.
Once again, assuming it is in the same folder as the others (otherwise, write the full path to play_video.bat)
Main batch:
I don't think it's possible, but can one activate "repeat" in this media player with command line parameters? I can't think of other way to enable it via batch.
Everything below this line must be read assuming you can't enable "repeat" with CL parameters.
By the way, let's assume 3 other things:
1. You're using media player classic (executable name: "mpc hc.exe")
2. The video file is in the same folder as mpc hc.exe and its name is "video file.avi"
3. The batch script is in the same folder as mpc hc.exe
You said the video has 2 minutes; we can do something like this:
Code: Select all
@echo off
set "n=15"
::n is the number of times you want the video to loop
::if program = 30mins of lenght and video = 2mins, then n should be 15
for /l %%n in (1 1 %n%) do (
start "" "mpc hc.exe" "video file.avi"
>nul ping -n 121 localhost
taskkill /f /im "mpc hc.exe"
)
Let's call this script "play_video.bat".
And you would probably have to start it from another batch.
Once again, assuming it is in the same folder as the others (otherwise, write the full path to play_video.bat)
Main batch:
Code: Select all
@echo off
:video
start /min play_video.bat
if not %errorlevel% == 0 goto video
:YourCode
::your code here
Re: How to play video file repeatedly using command prompt
Awesome..!!!
But, the real problem is there will be multiple windows opened and there might be a delay in opening
file due to the other vbscript running in the background..
Thanks a lot.. Fawers!!!
But, the real problem is there will be multiple windows opened and there might be a delay in opening
file due to the other vbscript running in the background..
Thanks a lot.. Fawers!!!
Re: How to play video file repeatedly using command prompt
rajeev wrote:But, the real problem is there will be multiple windows opened and there might be a delay in opening
file due to the other vbscript running in the background..
You can change the FOR loop PING delay, if you wish to.
Remember: imagination is our only limit.
Re: How to play video file repeatedly using command prompt
There is no command line option to enable the loop mode for WMPlayer. The only possibility is to change the registry setting before you run it.
Tested on my Win7 (x86) with WMP version 12:
Of course that has no effect if the WMP is already running.
Regards
aGerman
Tested on my Win7 (x86) with WMP version 12:
Code: Select all
:: turn on loop mode
reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 1 /f
:: turn off loop mode
reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 0 /f
Of course that has no effect if the WMP is already running.
Regards
aGerman
Re: How to play video file repeatedly using command prompt
aGerman wrote:There is no command line option to enable the loop mode for WMPlayer. The only possibility is to change the registry setting before you run it.
Tested on my Win7 (x86) with WMP version 12:Code: Select all
:: turn on loop mode
reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 1 /f
:: turn off loop mode
reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 0 /f
Of course that has no effect if the WMP is already running.
Regards
aGerman
Great!!!
Simple & Perfect.. It's working ..
Thanks a lot...aGerman