0

subtitles using timecode Events



I am trying build a file name from the index of a timecode Event, but I obviously missing something basic. <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> if msg.GetInt() = 12 then print "event:", msg.getData() a = "t" b = msg.getData() ' <-- = "1", or is this an object instead of a string? c = ".png" st = a+b+c ' <--- crashes here!!! i.displayFile(st) ' <--should end up as "t1.png" The intention is recreate the effect of subtitles using timecode events and images. Also, Is there a setvisible() option for for any of the objects? Later I'll add button inputs to turn them on/off, or change languages, etc Peter

6 comments

  • 0
    Avatar
    RokuLyndon


    msg.GetData gives you the event ID, not a string.

    You have to have a separate text file that has the text and time codes. The brightsign can't pull the cc data from the video itself.

    The video event with ID 12 is for timed events that you add to the video.

    Let's say that you know this string "This is a test" represents dialog starting at 32 seconds, then you can add an event to your video so that at the 32 second mark, you can display that text in your text box.

    If you've using a text widget, you can show or hide it.
  • 0
    Avatar
    tangopeter


    Hi Lyndon,

    What I was attempting to do was take the .addEvent ID and convert it into a character that I could then build into the file name string with.
    From the videoplayer.addEvent() example in the object guide:


    p = CreateObject("roMessagePort")
    v.setPort(p)
    ok = v.addEvent(1,1000)
    ok = v.addEvent(2,5000)
    ...
    ...
    ' and then do:
    if msg.GetInt() = 12 then
         print "event:", msg.getData()  
         filename = STR$(msg.getData() )                 ' Something like this
         filename =  filename+'.png"                         ' add extension
         i.displayFile(filename)                                 ' Display image
    ...


    I'm trying to to this as a semi-generic script that doesn't require the actual text to be entered as well.
    Then I would only need to list the actual .addEvent timings in the beginning of the script and the event loop would just play the appropriate image file without having to list them all individually as text.
    The script would also use the state of a variable (button controlled) that would determine whether the the image was a blank image (no subtitles), language 1, language 2, etc. The images would be created using a subtitle creator tool.

    If this isn't possible, then I guess I could do this with a counter that gets incremented each time the event is triggered.

    Peter
  • 0
    Avatar
    M Tavan

    Hi Lyndon,

     

    So if I understand well, it is a way to add subtitles to videos... Even, it is also possible to hide or show the subtitles...?

     

    I always thought it was not possible with BS players... (so I never use BS players for  projects that requires subtitles...)

    Maybe it can be done with TC events now?

     

    Regards,

     

    Michaël

  • 0
    Avatar
    Alex

    Michaël, you can show subtitles using a custom script. The brightsign won't decode a caption from a video. The caption would have to be in a separate text file. You can then use a custom script to parse the text file and insert the messages over the video during playback. Here's a link to a simple example:

    https://www.brightsignnetwork.com/download/Tools/Subtitles.zip

  • 0
    Avatar
    J Bryans

    Hi guys,

    Bit of a blast from the past here, but I've been using the subtitle tool posted on this thread for an exhibition but can't get the text to be centrally justified within the text box. I'll admit I'm fairly new to this but I've tried adding/changing quite a lot of the script and it keeps failing!

    Any help would be gratefully received. I'm sure it's one or two lines of script that I just can't wrap my head around.

    Many thanks

    Jeremy

  • 0
    Avatar
    Romeo

    Hi Jeremy,

    in the script comment out the line that says s.text=CreateObject("roTextWidget", s.rect, 2, 2, 0) and replace it with

     s.TxtParam = CreateObject("roAssociativeArray")
     s.TxtParam.Alignment = 1
     s.text=CreateObject("roTextWidget", s.rect, 2, 2, s.TxtParam)

    So that section of the script will look like the below block

     's.text=CreateObject("roTextWidget", s.rect, 2, 2, 0)
     s.TxtParam = CreateObject("roAssociativeArray")
     s.TxtParam.Alignment = 1
     s.text=CreateObject("roTextWidget", s.rect, 2, 2, s.TxtParam)

    Romeo

     

Please sign in to leave a comment.