Log in

View Full Version : Can AviSynth read SMPTE timecode?


spyros78
27th May 2008, 09:12
Hi all,

I've been looking around for a tool that can access the GOP structure, read the SMPTE timecode of an MPEG-2 file and display it on screen. ShowSMPTE is not really showing the actual SMPTE timecode, it just displays the running time using the SMPTE format. I know I can insert an offset but I have hundreds of videos I have captured from DigiBeta and need to batch process them. Until now I have not found any tool that does this and I'm thinking there must be a reason why this can't happen.

Many thanks for your time.

sp.

mikeytown2
27th May 2008, 10:26
This might be a place to start if your using DGIndex (http://neuron2.net/dgmpgdec/dgmpgdec.html) to load the files.
http://forum.doom9.org/showthread.php?t=110021


What is the reason for the offset? Unrecorded spots on the tape? Did the capture device get the SMPTE code from the DigiBeta (http://en.wikipedia.org/wiki/Betacam#Digital_Betacam)cam? If you have the raw data, it appears that DigiBeta stores the info in the Linear Timcode (http://en.wikipedia.org/wiki/Linear_timecode) format.

spyros78
27th May 2008, 14:11
This might be a place to start if your using

DGIndex (http://neuron2.net/dgmpgdec/dgmpgdec.html) to load the files.
http://forum.doom9.org/showthread.php?t=110021


What is the reason for the offset? Unrecorded spots on the tape? Did the capture device get the SMPTE code

from the DigiBeta (http://en.wikipedia.org/wiki/Betacam#Digital_Betacam)cam? If you have the raw

data, it appears that DigiBeta stores the info in the

Linear Timcode (http://en.wikipedia.org/wiki/Linear_timecode) format.

mikeytown2,

I'm capturing DigiBeta tapes (of a Sony J-30 DigiBeta machine) using a hardware encoder in MPEG-2. The SMPTE timecode is stored both in the VITC and LTC. My encoder grabs the timecode fine because I can then play the MPEG-2 files with a media player and see the timecode being consistent with the one on tape. The MPEG-2 files are then transcoded to various other formats. I need to:

1. Access the timecode
2. Display it on screen

ShowSMPTE does not display the recorded timecode! It only displays the running time using the SMPTE format. This is the reason for the offset. I can use an offset of let's say 09:59:58:00 if I know this is the starting point of my actual timecode and this would work ok for a single file but not for a bach.

I'm going to try the plugin you showed me and update you.

Thanks for your time + support.
sp.

spyros78
29th May 2008, 12:06
This might be a place to start if your using DGIndex (http://neuron2.net/dgmpgdec/dgmpgdec.html) to load the files.
http://forum.doom9.org/showthread.php?t=110021

Hi,

managed to make it work however, it seems hdvinfo only supports date/time and not SMPTE timecode.

Why is there no tool to do this? It should not be that hard right? The timecode information is embedded in the GOP structure right?

Thanks in advance

sp.

mikeytown2
29th May 2008, 12:32
You could go over and bug the maker of DGIndex and request this feature again (http://neuron2.net/board/viewtopic.php?p=5184#5184). First try setting "info" in MPEG2Source() (http://neuron2.net/dgmpgdec/DGDecodeManual.html#MPEG2Source), if your lucky it might be in there. If it is, ask around, you might be able to get the timecode out without a lot of work.

SynchronousArts
31st May 2008, 00:47
I can then play the MPEG-2 files with a media player and see the timecode being consistent with the one on tape.

sp.

@spyros78,

What media player are you using to see the timecode?

The only players I've seen that will do this are based on the VideoPlex decode boards.

Thanks

SA

SynchronousArts
14th July 2008, 23:36
Thinking more about this problem, there are 2 ways to get this done.

The easy way is to return a static start Timecode variable that can be used for an offset within
ShowSMPTE(). This should work fine for clips that have continuous Timecode.

The second, more complex way will require a modification of ShowSMPTE that will evaluate
the Timecode for every frame based upon a named data source like “filename.d2v”. DGIndex
will need to read the Timecode from the Sequence Header of each GOP and record it into the d2v file.

A sample .d2v file might look like this:


DGIndexProjectFile16
1
E:\Test.mpv

Stream_Type=0
MPEG_Type=2
iDCT_Algorithm=6
YUVRGB_Scale=1
Luminance_Filter=0,0
Clipping=0,0,0,0
Aspect_Ratio=4:3
Picture_Size=720x480
Field_Operation=0
Frame_Rate=29970 (30000/1001)
Location=0,0,0,232c5

d00 5 0 0 0 0 0 b2 b2 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 T01 00 00 00
900 5 0 225432 0 0 0 32 32 92 b2 b2 a2 b2 b2 a2 b2 b2 a2 T01 00 00 12
....
900 5 0 294722456 0 0 0 30 30 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 T01 05 20 22
900 5 0 294939872 0 0 0 30 30 90 b0 b0 a0 b0 b0 a0 b0 b0 a0 T01 05 21 02
900 5 0 295013632 0 0 0 30 30 90 b0 b0 a0 ff T01 05 01 12

FINISHED 85.79% VIDEO

The Time code for each GOP is listed at the end if each line T01 00 00 00 etc.

ShowSMPTE(“E:\Test.d2v", x=360, y=400, size=48, text_color=$EEEEEE)

will open the .d2v file and sync it's frame counter to the Timecodes listed in the file.

The downside is if the source contains any Telecine, the overlay will get messed up after IVTC and
you won't be able to call ShowSMPTE after IVTC since the framerate will have changed.

Thanks

SA