0

HD2000 scripting question



I have a csv file that has two video file and one black picture as an idle screen. The files are triggered through the GPIO port. Also several GPIO outputs are turned on depending on which video is played and turned off when the idle screen is called. The problem is I need two of the GPIO outputs to turn off while the video is playing, each at a different time. Can I do this though a script? If so how easy would it be as I am not used to writing scripts for these players.

Thanks

12 comments

  • 0
    Avatar
    RokuLyndon


    IF you look at the object reference guide, under rovideoplayer, or rovideoevent, you'll find details for adding timer events to a video, that you can then listen to during playlist.



    So, you could modify the autorun file you're using so that when this specific video plays, two events are added. And, you could then modify the part of the autorun that listens for rovideoevent. There you would check if the video event matched the ID you set when you added it. And, if it's a match, you can then turn off the gpio you want off.
  • 0
    Avatar
    Chuck Drew


    I understand the concept, looked at the guides but not sure how to include the statements in the autoplay.csv file. Would I have to scrap using a csv file and use a playlist?



    Thanks

    Chuck
  • 0
    Avatar
    RokuLyndon


    You would have to make changes to the autorun file that processes the csv. Can you provide a little more detail about what needs to happen when this specific video is playing?
  • 0
    Avatar
    Chuck Drew


    Would it help if I sent you the csv file. I think that it would be easy to understand if you saw it.



    Thanks,

    Chuck
  • 0
    Avatar
    Chuck Drew


    I have not heard from you yet. Can I still send you the csv file for your evaluation? If so, where?



    Thanks,

    Chuck
  • 0
    Avatar
    Chuck Drew


    This is the current csv file...



    IMAGEMODE,2,,,

    VIDEOMODE,720x480x60p,,,

    VIDEOPLAYERAUDIOOUTPUT,3,,,



    EVENTS,,button:0,button:1,videoend

    STATE,blank.bmp:gpios(),video1.mpg,video2.mpg,

    STATE,video1.mpg:gpios(0;1;2),video1.mpg,video2.mpg,blank.bmp

    STATE,video2.mpg:gpios(0;1;3),video1.mpg,video2.mpg,blank.bmp





    Now, what needs to happen is there needs to be a two second delay before either video1 or video 2 plays GPIO 1 needs to turn off at 23min 30sec as the video is 25min and the duration of GPIO 2 and 3 when called to turn on needs to be 2sec.
  • 0
    Avatar
    RokuLyndon


    Which brightsign are you using? Please send me the csv at <!-- e --><a href="mailto:support@brightsign.biz">support@brightsign.biz</a><!-- e -->? Also, what firmware are you using?



    What we'll need to do is modify the autorun that's processing the csv file to add events before the file is played.





    What gpios need to be turned on and off during the video, and at what times? Are there different gpios depending on he video?



    For example to add an event for 23 minutes and 30 seconds, we would do this:



    video.AddEvent(1, 1410) 'time in seconds, message ID 1



    Then to listen we would make a change where we listen for csv events, under the check for roVideoEvent. In this example below, we listen for a timer event, ID 12, and then if the timer ID = 1, we turn off gpio 3.



    If type(msg) = "roVideoEvent" then

      if msg.GetInt() = 12 then

          if msg.GetData() = 1 then gpio.SetOutputState(3,false)

      endif

    endif





    Also, for the delay, we can manually add the delay in the autorun, by adding a sleep(2000), for two seconds, before the video.PlayFile() command.





    Similarly, we can listen where gpios are turned off and on. And, if it's gpio2 or gpio3, then we can manually switch the output state after waiting for x number of seconds.



    I just need to know which firmware you have to decide which autorun to modify.
  • 0
    Avatar
    Chuck Drew


    I sent you the csv from my yahoo account.





    The way it should work is this;



    At startup and when a video is not playing blank.bmp should be displayed with all GPIO's off.



    Button 0 activates video1 after a delay of 2 seconds and turns on GPIO 0,1,2. GPIO 1 would turn off 23 minutes and 30 seconds after video starts and GPIO 2 would turn off 2 seconds after video starts.



    Button 0 activates video2 after a delay of 2 seconds and turns on GPIO 0,1,3. GPIO 1 would turn off 23 minutes and 30 seconds after video starts and GPIO 2 would turn off 3 seconds after video starts.



    After either video stops playing it should go back to blank.bmp and wait for button input again.



    I'm also posting this to the forums so it might help other too.



    Thanks,

    Chuck
  • 0
    Avatar
    Chuck Drew


    Did you get the file? Have you had a chance to modify the bas file?



    Thanks,

    Chuck
  • 0
    Avatar
    Chuck Drew


    Lyndon,



    I've sent you the file you requested sometime ago as requested and have not heard from you even after calling twice. Are you going to be able to help on this? If not let me know as I need to let my client know what's going on.





    Chuck
  • 0
    Avatar
    Chuck Drew


    Lyndon,



    I received the new csv last week and was able to install tonight with no luck. The system operates as if it is operating only on the csv file as is. Like it does not see the new lines you put in the file. I did look at the csv file and saw what you added. The GPIO outputs that are supposed to turn off at the different times are turning off at the end of the video, just like reading the csv file alone. I'll email you also. Oh, I did verify the version on the HD2000, 2.0.94 (00:0d:4b:34:55:c2).



    Chuck
  • 0
    Avatar
    Chuck Drew


    Might have found the problem. More tomorrow.....
Please sign in to leave a comment.