24 Replies Latest reply on Oct 26, 2015 4:29 AM by hmiril

    Using timecode as subtitle showing date and time

    kapten1 Level 1

      Hi, this will be my first post at this forum.

      I've got a camcorder called Panasonic HDC-SD900.

      Some specs:

      Footage

      • 1080p/50
      • AVCHD with full BDMV folder structure
      • Timecode information for shot date and time

      Storage

      • Footage recorded on Transcend SDXC 32GB
      • Footage then copied to computer HDD

       

      My question

      For the last week i've been up day and night editing in Premiere Pro CS6 - Project settings as "AVCHD 1080p50".

      In the early stage of this amateur project I noticed the timecode when skimming through the MTS-files in different media players such as VLC and XBMC, but also in the simple editing tool Final Mate.

      In both VLC and XBMC this timecode acts like a subtitle that can be turned on and off through the regular built in subtitle functions.

      What I want to accomplish is keeping the timecode exactly like it's displayed before the edit, and also keep the ability to turn it on and off.

      When the movie, that will contain alot of different clips is finnished, I want the timecode to show which day and time every single clip was shot.

      So, what do you think? Is this possible? I couldn't find any discussion from before that truely handled the same question as mine.

      I'm also attaching a screenshot of the timecode that looks the same in the three different softwares.

      Thank you in advance for any advice in this matter.

      /kapten1

       

       

      timecode-vlc-xbmc-finalmate.jpg

        • 1. Re: Using timecode as subtitle showing date and time
          Jim_Simon Level 8

          Apply the Timecode effect to the clips, and in the effect settings, change Timecode Source from Media to Clip.

          • 2. Re: Using timecode as subtitle showing date and time
            kapten1 Level 1

            Thanks for your reply.

            I've done this before but tried again. There is indeed a timecode appearing but it will only show a time counter based on how long the playback is.

            I'm applying the timecode effect on a clip that's allready trimmed on the timeline.

            Untitled-5.jpg

            • 3. Re: Using timecode as subtitle showing date and time
              Jim_Simon Level 8

              That is the timecode on the clip.  What you see in the other programs is the Date/Time metadata, not timecode.  PP can't display the metadata overlay like that.

              • 4. Re: Using timecode as subtitle showing date and time
                kapten1 Level 1

                Oh I see. Thats why it's so hard to find any information about this.

                Actually I've been playing around with a tool called Exif Tool, but it did'nt help me much.

                Do you know any other way of accomplishing this? Maybe extraction of the META or something like that?

                • 5. Re: Using timecode as subtitle showing date and time
                  Jim_Simon Level 8

                  As far as I know, there's no way to do this with Adobe software, so you'll have to look to other tools.

                   

                  DVDate is a program that could do this with DV files.  I have no idea if it'll work with your media.

                  • 6. Re: Using timecode as subtitle showing date and time
                    kapten1 Level 1

                    I'm now reading the users manual and there is a difference between AVCHD and 1080p/50. This is two different recording modes and I use the 1080p/50 mode, but I've still got the AVCHD folder structure and all that.

                     

                    I will keep looking in to this. Thank you, hopefully other people can gain som perspective on this matter like I did.

                    • 7. Re: Using timecode as subtitle showing date and time
                      Malcev.Z Level 1

                      DVDate is a program that could do this with DV files.  I have no idea if it'll work with your media.

                      It will not work.

                      You can do it by hand.

                      Just put your footage on timeline.

                      Then create title with date and add generated timecode effect with copied metadata on it.

                      Crop seconds and miliseconds and if you want nest with your footage.

                      • 8. Re: Using timecode as subtitle showing date and time
                        kapten1 Level 1

                        How can I copy the metadata to the effect?

                        I'm looking at the metadata tab in PP right now and there are some different posts with date and time information. Which one is the source to the overlay I see during playback in VLC?

                        • 9. Re: Using timecode as subtitle showing date and time
                          Malcev.Z Level 1

                          Premiere can't read metadata of MTS.

                          You can use exiftool and rename all your files with date and time of shooting.

                          Just create this bat file in folder with your footages and exiftool.

                          exiftool "-FileName<dateTimeOriginal" -d "%%Y-%%m-%%d_%%H-%%M-%%S.%%%%e" *.MTS

                          • 10. Re: Using timecode as subtitle showing date and time
                            Jim_Simon Level 8

                            I'm now reading the users manual and there is a difference between AVCHD and 1080p/50.

                             

                            There actually isn't.  1080p/50 (as well as 1080p/60) became a part of the AVCHD specification in 2011.

                            • 11. Re: Using timecode as subtitle showing date and time
                              Jim_Simon Level 8

                              Premiere can't read metadata of MTS.

                               

                              Sure it can.

                              • 12. Re: Using timecode as subtitle showing date and time
                                kapten1 Level 1

                                Malcev.Z,

                                Thats very helpfull, I will try it tomorrow, but wouldn't that destroy my folder structure? Iv'e read that the clipinf-folder is very fragile to changes of the tree.

                                What kind of output do i get after i use exiftool?

                                • 13. Re: Using timecode as subtitle showing date and time
                                  Malcev.Z Level 1

                                  CS5.5 can't. May be CS6 can.

                                  But if not then You can use modified bat file.

                                  exiftool -ext mts "-FileName<dateTimeOriginal" -d "%%Y-%%m-%%d_%%H-%%M-%%S.%%%%e" %*

                                  Just place exiftool.exe to windows directory and drag'n'drop file or folder to that bat file.

                                  • 14. Re: Using timecode as subtitle showing date and time
                                    kapten1 Level 1

                                    I tried the batch and it worked. But know what? The filename got the correct date and time, but how will this be in any use to the overlay im looking for?

                                    • 15. Re: Using timecode as subtitle showing date and time
                                      Malcev.Z Level 1

                                      Overlay only by hands.

                                      Just put your footage on timeline.

                                      Then create title with date and add generated timecode effect with copied metadata on it.

                                      Crop seconds and miliseconds and if you want nest with your footage.

                                      As I think You do not need renaming your footages - You need just get time and date as text list from which you will copy data to the title and timecode effect.

                                      Therefore use this script (just drag'n'drop folder to this bat)

                                      exiftool -ext MTS -r -T -FileName -dateTimeOriginal -d "%%d-%%m-%%Y     %%H:%%M:%%S:00" %* > E:\Your_Path\out.txt

                                       

                                      • 16. Re: Using timecode as subtitle showing date and time
                                        kapten1 Level 1

                                        I thank you for that, once again.

                                        I've also successfully created .srt subtitle files from frame specific metadata using a tool called avchd2srt. But, there seems to be two different kinds of standards of this metadata, depending on camera model. At first this difference caused all the generated subtitles going too fast. Every line in the .srt were only 0.5 seconds. Since I was not too comfortable this command prompt based application I found subtitlemaker_v0.35 instead. This is based of the same tool but with an easy GUI where you also have the option to choose between those two camera kinds. I'm sure this is possible in the cmd version also, but I couldn't find it. It also has a great batch function built in.

                                        As you can see in the picture the srt file contains all the metadata from my mts (Panasonic HDC-SD900, Camera Type 0).

                                        After this I loaded all the files in Notepad++ and did find/replace so that I got swedish weekdays and number 10 instead of Oct and so on.

                                        But I'm not ready to leave the subject for closing yet. Now I wonder if PP can read srt subtitles and then as I trim the clips, PP automatically also trims the subtitles?

                                        Edit: And oh! If anyone will use this method, the program can NOT read capitalized file extensions (MTS/mts). I renamed all of them with cmd command ren *.MTS *.mts

                                        subtitlemaker.jpg

                                        • 17. Re: Using timecode as subtitle showing date and time
                                          shooternz Level 6

                                          Let us know if Premiere can read these... but I suspect you may need to convert them to something graphical.

                                          • 18. Re: Using timecode as subtitle showing date and time
                                            kapten1 Level 1

                                            Premiere Pro CS6 can not import .srt files. The file extension is not listed in the supported formats list when I try to import. There are hundreds of effects to download, I would be surprised if there was none for handling srt files and then maybe merge them together in the project. Thats my plan for now.

                                            • 20. Re: Using timecode as subtitle showing date and time
                                              kapten1 Level 1

                                              I will download EZTitles trial right away, I'm afraid it's just for burn the sub to the video though.

                                              This seems also interesting, Adobe Encore CS6 has a subtitle function for overlay that can be turned on and off on the DVD or BluRay http://infiniteskills.com/blog/2012/07/adobe-encore-cs6-tutorial-subtitles/

                                              • 21. Re: Using timecode as subtitle showing date and time
                                                Malcev.Z Level 1

                                                I'm afraid it's just for burn the sub to the video though.

                                                 

                                                No, It creates "one big title" But for me it is not comfortable to use this program for subtitling.

                                                I have written script on autohotkey, which converts srt, txt and so on to premiere titles format and creates edl.

                                                I have modified it for your situation.

                                                 

                                                 

                                                1. Text = D:\temp\1.txt             ; change to file with subtitles

                                                  watchfolder = D:\temp\              ; change to folder in which will be created titles (after script starts all prtl files in that folder will be deleted)

                                                  prtlPath = D:\temp\TITRI\          ; change to title template. It has to be 1 line with any text and called - "1.ptrl"

                                                  EDL = D:\temp\1.edl       ;  change to path to edl. (after script starts this file will be deleted)

                                                   

                                                  SetBatchLines, -1

                                                  FileEncoding, UTF-16

                                                  FileDelete, %watchfolder%\*.prtl

                                                  Loop, read, %Text%

                                                  {

                                                     If A_LoopReadLine is digit

                                                     {

                                                        str .= "`n"

                                                        continue

                                                     }

                                                     str .= A_LoopReadLine . "`n"

                                                  }

                                                  string := RegExReplace(Trim(str,"`r`n"), "\R[\R\s]+", "`n`n")

                                                  SubStrList := RegExSplit(string, "S)\n\n")

                                                  for index, substring in SubStrList

                                                                          string%A_Index% := substring, Lines%A_Index% := SymbCount(substring, "`n")+1

                                                  n := SubStrList.MaxIndex()

                                                  Loop % n

                                                  {

                                                     String := string%A_Index%

                                                     k := Lines%A_Index% - 1

                                                     FileRead, prtl, %prtlPath%\%k%.prtl

                                                     XPos := 0

                                                     Loop, parse, String, `n, `r

                                                     { 

                                                                                    if (A_Index = 1)

                                                                                    {

                                                                                                                   Timecode .= A_LoopField "`n"

                                                                                                                   Continue

                                                                                    }

                                                                                    if (A_LoopField = "")

                                                                                                                   Continue

                                                   

                                                                                    StrLength := StrLen(A_LoopField ) + 1

                                                                                    XPos := RegExMatch(prtl, "<XPos>", "", XPos + 1)

                                                                                    prtl := RegExReplace(prtl, "<CharacterAttributes RunCount="".*?"""

                                                                                                                          , "<CharacterAttributes RunCount=""" StrLength """"

                                                                                                                          , "", 1, XPos - 1)

                                                   

                                                                                    StringReplace, LoopField, A_LoopField, &, &amp;, 1

                                                   

                                                                                    if (k > 1)

                                                                                    {

                                                                                                                   k:=k-1

                                                                                                                   prtl := RegExReplace(prtl, "<TRString TXMarker=""Booyah"">.*?</TRString>"

                                                                                                                  , "<TRString TXMarker=""Booyah"">" LoopField "</TRString>"

                                                                                                                   , "", 1, XPos - 1)

                                                                                    }

                                                                                    Else

                                                                                                                   prtl := RegExReplace(prtl, "<TRString>.*?</TRString>"

                                                                                                                   , "<TRString>" LoopField "</TRString>")

                                                                          }

                                                   

                                                     FileName := "title" . SubStr("000", 1, -(StrLen(A_Index))) . A_Index . ".prtl"

                                                     FileAppend, % prtl, %watchfolder%\%FileName%

                                                  }

                                                   

                                                  n:=1

                                                  TimecodesList := RegExReplace(Trim(Timecode,"`r`n"), " ", "")

                                                  Loop, parse, TimecodesList, `n, `r

                                                  {

                                                     Timecodes = %A_LoopField%

                                                     StringReplace, Timecodes, Timecodes, -, , All

                                                     StringSplit, string, Timecodes, >

                                                     x = % string1

                                                     xx = % string2

                                                     StringSplit, y, x, `,

                                                     z := Ceil(y2*25/1000)

                                                     SetFormat, Float, 02.0

                                                     z += 0.0

                                                     StringSplit, yy, xx, `,

                                                     zz := Ceil(yy2*25/1000)

                                                     SetFormat, Float, 02.0

                                                     zz += 0.0

                                                   

                                                     varTimecode1 = %y1%:%z%

                                                     varTimecode2  = %yy1%:%zz%

                                                   

                                                     StringSplit, Timecode1Array, varTimecode1, :

                                                     StringSplit, Timecode2Array, varTimecode2, :

                                                   

                                                     Digit4:

                                                     if (Timecode2Array4 < Timecode1Array4)

                                                     {

                                                                          Timecode2Array4 += 25

                                                                          Timecode2Array3 -= 1

                                                                          DurationArray4 := Timecode2Array4 - Timecode1Array4

                                                                          gosub, Digit3

                                                     }

                                                     if (Timecode2Array4 >= Timecode1Array4)

                                                                          DurationArray4 := Timecode2Array4 - Timecode1Array4

                                                   

                                                     Digit3:

                                                     if (Timecode2Array3 < Timecode1Array3)

                                                     {

                                                                          Timecode2Array3 += 60

                                                                          Timecode2Array2 -= 1

                                                                          DurationArray3 := Timecode2Array3 - Timecode1Array3

                                                                          gosub, Digit2

                                                     }

                                                     if (Timecode2Array3 >= Timecode1Array3)

                                                                          DurationArray3 := Timecode2Array3 - Timecode1Array3

                                                   

                                                     Digit2:             

                                                     if (Timecode2Array2 < Timecode1Array2)

                                                     {

                                                                          Timecode2Array2 += 24

                                                                          Timecode2Array1 -= 1

                                                                          DurationArray2 := Timecode2Array2 - Timecode1Array2

                                                                          gosub, Digit1

                                                     }

                                                     if (Timecode2Array2 >= Timecode1Array2)

                                                                          DurationArray2 := Timecode2Array2 - Timecode1Array2

                                                   

                                                     Digit1:

                                                     if (Timecode2Array1 < Timecode1Array1)

                                                     {

                                                                          msgbox, Timecode2Array1 %Timecode2Array1% < Timecode1Array1 %Timecode1Array1%

                                                                          msgbox, The "Start" timecode cannot be less than the "End" timecode.

                                                                          ExitApp

                                                     }

                                                     if (Timecode2Array1 >= Timecode1Array1)

                                                                          {

                                                                                                          DurationArray1 := Timecode2Array1 - Timecode1Array1 + 1

                                                                                                          goto, EndProcess

                                                                          }

                                                   

                                                     EndProcess:

                                                     SetFormat, Float, 02.0

                                                     Loop, 4

                                                                          DurationArray%A_Index% += 0.0

                                                     TitleDuration%n% = %DurationArray1%:%DurationArray2%:%DurationArray3%:%DurationArray4%

                                                     StartTimecode%n% = %y1%:%z%

                                                     EndTimecode%n% = %yy1%:%zz%

                                                     n++

                                                  }

                                                   

                                                  EDLvar = TITLE: Sequence 01`n`n

                                                  Var = 000

                                                  SetFormat, float, 03.0

                                                  loop % n - 1

                                                  {

                                                     StartTimecode := StartTimecode%A_Index%

                                                     EndTimecode := EndTimecode%A_Index%

                                                     TitleDuration := TitleDuration%A_Index%

                                                     TitleName := "title" . SubStr("000", 1, -(StrLen(A_Index))) . A_Index

                                                     Var += 1.0

                                                     EDLvar .= Var "  AX       V     C        01:00:00:00 " TitleDuration " " StartTimecode " " EndTimecode "`n* FROM CLIP NAME: " TitleName "`n`n"

                                                  }

                                                  FileDelete, %EDL%

                                                  FileAppend, % EDLvar, %EDL%, UTF-8

                                                  Msgbox, Done

                                                  ExitApp

                                                   

                                                   

                                                   

                                                   

                                                  SymbCount(ByRef string, symb) {

                                                                          count := 0

                                                                          loop, Parse, string

                                                                                                          (A_LoopField == symb) && ++count

                                                                          return count

                                                  }

                                                   

                                                   

                                                  RegExSplit(ByRef in, delim = "") {

                                                                          pos := 0, start := 1, Obj := []

                                                                          while, pos := RegExMatch(in, delim, match, start)

                                                                                                          Obj.Insert(SubStr(in, start, pos - start)), start := pos + StrLen(match)

                                                                          Obj.Insert(SubStr(in, start))

                                                                          return Obj

                                                  }

                                                • 22. Re: Using timecode as subtitle showing date and time
                                                  kapten1 Level 1

                                                  Thats a real effort! Thanks, but when I try to run the batch it hangs at this point and then tells me The "Start" timecode cannot be less than the "End" timecode.

                                                   

                                                  My test srt with txt extension:

                                                  1

                                                  00:00:03,860 --> 00:00:04,860

                                                  Söndag 28-10-2012 15:32:59

                                                   

                                                  2

                                                  00:00:04,860 --> 00:00:05,820

                                                  Söndag 28-10-2012 15:33:00

                                                   

                                                  3

                                                  00:00:05,820 --> 00:00:06,840

                                                  Söndag 28-10-2012 15:33:01

                                                   

                                                  4

                                                  00:00:06,840 --> 00:00:07,800

                                                  Söndag 28-10-2012 15:33:02

                                                   

                                                  5

                                                  00:00:07,800 --> 00:00:08,820

                                                  Söndag 28-10-2012 15:33:03

                                                  • 23. Re: Using timecode as subtitle showing date and time
                                                    Malcev.Z Level 1

                                                    Try this

                                                    http://pastebin.com/bbrwFZ6U#

                                                     

                                                    You have to download autohotkey and then create new autohotkey scrit and paste this code.

                                                    • 24. Re: Using timecode as subtitle showing date and time
                                                      hmiril Level 1

                                                      Hi,

                                                       

                                                      I have to know how did you manage to see the timecode in VLC like this...