The Latest from the Australian Mobile Electronics Industry Since 1999 60,000+ Readers Per Month! Get the MEA iPhone App

Jump to content


Automatically playing video in 10 second blocks.


10 replies to this topic

#1 Steve77

    25 - 250w RMS

  • Members
  • 192 posts
  • Gender:Male
  • Interests:Photography, music, HiFi
  • State:SA

Posted 05 July 2011 - 08:11 PM

Hi, just wondering if anyone knows of a way to automatically play video clips in 10 second blocks, without having to keep an eye on the counter? Ideally, it would play exactly 10 seconds then pause till it's told to play the next 10 second block, and so on.

It's for a uni project I'm about to start - apparently the uni doesn't have a way of doing this or doesn't know how to. I think the files are .mpg, but not 100% on that.

Maybe some kind of free video editing software could do this? But then again uni might not let me install programs on their PC.

Any advice would be appreciated

#2 atmo

    500 - 1500w RMS

  • Members
  • 633 posts
  • Gender:Male
  • Location:Geelong
  • Interests:10.5%
  • State:VIC

Posted 05 July 2011 - 09:48 PM

Split the file into multiple 10 second long files (Windows movie maker will do it if you don't have better editing software). In PowerPoint, add each clip to a slide. Set the first clip to start on click, for the rest, set them to start playing automatically. At the end of each clip it will hold on the last frame, when you click or go to the next slide the next clip will start playing.

It's probably not the only way of doing it, but without knowing what software is available it's hard to say (I'm assuming Office will be installed on a Uni PC).

2010 Focus XR5 Turbo

Source: Alpine INA-W900E + H100

Fronts: Focal Utopia 165W / Alpine PDX F6

Sub: AlpineType S 12 / Alpine PDX M12


#3 Sigmeister

    500 - 1500w RMS

  • Members
  • 1,232 posts
  • Gender:Male
  • Location:Adelaide
  • Interests:Car Audio, Being a geek. Living in the 80's
  • State:SA

Posted 06 July 2011 - 09:25 AM

I can't even think how this would be used?? Can you give the full example of what you are trying to achieve?

What about just a tiny app that emulates 'CTRL+P' every 10 seconds? Or something similar?
Sigmeister
V6 Powered GH Sigma (99.08% completed....Lack of funds!)
Daily: VX Calais International - Stock Stereo
Trusted BuyersSellers: dcstraight, Mr_bob, Stik79, smeg, Ben_ra23, bobbyd, TEGBOY, nevrl8, Pyroay, Gozza
Posted Image

#4 Steve77

    25 - 250w RMS

  • Members
  • 192 posts
  • Gender:Male
  • Interests:Photography, music, HiFi
  • State:SA

Posted 07 July 2011 - 10:59 PM

Thanks Atmo and Sig

Yeah it must sound like an unusual request. It's for research into developmental disorders, and involves watching hours of footage of many people. Each 10 second block of video needs to be carefully watched, assessed and given a separate numerical score, which will provide lots of data which can then be analysed with statistics sofware.

So, given the large amount of footage and the need to consider each 10 sec block separately, I am looking for a way to automatically stop the video every 10 sec, so I can keep my eyes on the video instead of the timer, and to stop me from going insane.

An app that emulates 'CTRL+P' every 10 seconds does sound ideal, but I have no idea how to do that. I assume I would need to understand programming to do that?

#5 Selfdestruktor

    Über n00b!

  • Members
  • 1,470 posts
  • Gender:Male
  • State:TAS

Posted 07 July 2011 - 11:51 PM

Wish i'd seen this earlier, i've really got to be getting to bed.
This will be easy to do with a bit of Vbscript.
I'll have a crack at it tomorrow if I have time. :)

#6 Sigmeister

    500 - 1500w RMS

  • Members
  • 1,232 posts
  • Gender:Male
  • Location:Adelaide
  • Interests:Car Audio, Being a geek. Living in the 80's
  • State:SA

Posted 08 July 2011 - 04:52 PM

Selfdestruktor, on 07 July 2011 - 11:51 PM, said:

Wish i'd seen this earlier, i've really got to be getting to bed.
This will be easy to do with a bit of Vbscript.
I'll have a crack at it tomorrow if I have time. :)


Agreed, VBScript or powershell should be ableto do this easily.
Sigmeister
V6 Powered GH Sigma (99.08% completed....Lack of funds!)
Daily: VX Calais International - Stock Stereo
Trusted BuyersSellers: dcstraight, Mr_bob, Stik79, smeg, Ben_ra23, bobbyd, TEGBOY, nevrl8, Pyroay, Gozza
Posted Image

#7 Steve77

    25 - 250w RMS

  • Members
  • 192 posts
  • Gender:Male
  • Interests:Photography, music, HiFi
  • State:SA

Posted 10 July 2011 - 10:44 PM

I had never heard of VBscript before, so I googled it. Wikipedia talks about something called the Sendkeys method, and gives an example of sending some charcters every 2 seconds. I didn't even know how to run their example though :(


Wikipedia: "The SendKeys method sends one or more keystrokes to the active window (as if typed on the keyboard). In this example the script sends the characters “Hello World!” three times, each time pausing for 2 seconds (2000 milliseconds).

set shl = createobject("wscript.shell")
shl.sendkeys "Hello World!"
wscript.sleep 2000
shl.sendkeys "Hello World!"
wscript.sleep 2000
shl.sendkeys "Hello World!"
wscript.sleep 2000

The code should be saved as whatever.vbs, then executed using cscript.exe or wscript.exe in a command window. During execution, the characters “Hello World!” will be displayed after the command prompt."



Would Sendkeys be the method to use in my stuation to pause the video?

Edited by Steve77, 10 July 2011 - 10:47 PM.


#8 Selfdestruktor

    Über n00b!

  • Members
  • 1,470 posts
  • Gender:Male
  • State:TAS

Posted 12 July 2011 - 12:17 AM

Yep, that's part of it, and you obviously need 'Sleep' as well.
There are a few additional bits and pieces, including 'AppActivate', which switches focus to your chosen application if you haven't got that window active.
I think this is necessary to stop lots of clicking between windows.
Trouble is, it works with every bloody application except for bloody Windows Media Player!!! :P (well I can't work it out, anyway)
I've been trying for hours and can't work it out.

Anyway, I taught myself some different stuff (first time 'not' using Vbscript for me) and have come up with something for you to try.
Here's an exe that I just uploaded to the first fileshare site Google gave me: http://www14.zippysh...57575/file.html

Usage?: Set up your movie in Windows Media Player (i'm using version 12 in Win 7, but others should work too), maximize (but don't fullscreen) and leave paused.
Switch to another window, containing the folder where you've stored the program and run it.
It should switch to Media Player, unpause the movie, play it for 10 seconds, then pop up with a prompt asking whether you want to continue or not.
If yes, it will play for another 10 seconds, pause, play, pause, etc.....
If no, it will simply break out of the loop and the program will shut itself off.

A real programmer could probably do a better job, but it works (for me anyway).

Ha ha.... crap.... it's late.... nooooooo!!! I love sleep too much!!!

#9 iffer

    25 - 250w RMS

  • Members
  • 62 posts
  • State:WA

Posted 12 July 2011 - 11:24 AM

you might be making life harder by using WMPlayer
If you started with VLC, that already has scripting, and even http control modes built in.
Just a thought

edit:
here are some examples of making a web "page" that plays a file under javascript control
http://wiki.videolan...ation:WebPlugin

[more]
humm looks like WMP 11-12 understand dlna and uPnP av - so you might be able to script your playback via one of those command interfaces
(at least its another avenue of attack for you)
good luck! :)
Jen

Edited by iffer, 12 July 2011 - 06:40 PM.

Jennifer Cross, Programmer at large in Perth, WA

#10 Steve77

    25 - 250w RMS

  • Members
  • 192 posts
  • Gender:Male
  • Interests:Photography, music, HiFi
  • State:SA

Posted 13 July 2011 - 11:00 PM

Thanks for your help everyone :good:

I have downloaded the .exe file that Selfdestruktor made, and it works great on my computer. It will make my work a lot easier! :D
Now I just need to try it at uni next week. I assume it will work on their computer, unless there is some kind of security thing to stop us saving and running executable files.

The only other thing on my wishlist would be another button which would replay the previous 10sec block again when needed, but hey I'm not complaining - the .exe file is very helpful the way it is.

Thanks Selfdestruktor for your time and effort, it's much appreciated!

#11 Selfdestruktor

    Über n00b!

  • Members
  • 1,470 posts
  • Gender:Male
  • State:TAS

Posted 16 July 2011 - 12:40 AM

In the olden days, this would be easy in WMP, by programming in left and right cursor presses.
They just happened to skip you back and forward in 10 sec blocks.
However, starting in WMP 12 (I believe), you have to 'focus' on the progress bar thing (click on it) before this will work.

With my basically non-existent programming knowledge, and limitations of WMP, it's going to be pretty hard.
If it has to be something transportable, it might be better to go for the suggested VLC.
Don't have much time these days, but I might look into it at some stage.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users