View unanswered posts | View active topics It is currently 31 Jul 2014 15:37



Post new topic Reply to topic  [ 8 posts ] 
How to play video file repeatedly using command prompt 
Author Message

Joined: 10 May 2012 04:26
Posts: 9
Post How to play video file repeatedly using command prompt
Guys,

I need to run a video file through command prompt enabling "repeat"...
Could some one please help me.. ASAP

Thanks in Advance!! :)


10 May 2012 08:01
Profile

Joined: 08 Apr 2012 17:11
Posts: 187
Post 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?


10 May 2012 08:04
Profile WWW

Joined: 10 May 2012 04:26
Posts: 9
Post 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


10 May 2012 08:12
Profile

Joined: 08 Apr 2012 17:11
Posts: 187
Post 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:
Code:
@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:
@echo off
:video
start /min play_video.bat
if not %errorlevel% == 0 goto video

:YourCode
::your code here


10 May 2012 08:29
Profile WWW

Joined: 10 May 2012 04:26
Posts: 9
Post 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!!! :D


10 May 2012 08:39
Profile

Joined: 08 Apr 2012 17:11
Posts: 187
Post 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. :wink:


10 May 2012 08:43
Profile WWW
Expert

Joined: 22 Jan 2010 18:01
Posts: 1725
Location: Germany
Post 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:
Code:
:: 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


10 May 2012 11:47
Profile

Joined: 10 May 2012 04:26
Posts: 9
Post 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:
:: 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


16 May 2012 00:22
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], ShadowThief and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Forum style by Vjacheslav Trushkin for Free Forums/DivisionCore.