It is currently 26 May 2017, 23:39



How to find the length of a video clip

CasparCG Server, Client and development

Moderators: Macey, Jonas Hummelstrand, didikunz

How to find the length of a video clip

Postby ojan » 19 Nov 2012, 19:51

Hi
How can we get the length of a video clip?

thanx
ojan
ojan
 
Posts: 32
Joined: 29 Oct 2012, 08:59

Re: How to find the length of a video clip

Postby Macey » 19 Nov 2012, 20:22

Hi Ojan,

In 2.1, OSC will be supported (http://en.wikipedia.org/wiki/Open_Sound_Control)

You will be able to get the length of a clip thats playing through the ffmpeg consumer via that.

Regards
Andy
User avatar
Macey
 
Posts: 22
Joined: 25 Sep 2012, 16:41
Location: London, UK

Re: How to find the length of a video clip

Postby tsipas » 20 Nov 2012, 10:47

At curent version 2.0 you have the INFO command to see duration current frame and if file is play/stop(The file must be already added to a Layer).

An extra question from me can anyone managed to get the response from SERVER to HIS CLIENT using the .net dll who delivered from SVT?
User avatar
tsipas
 
Posts: 168
Joined: 05 Feb 2012, 18:31

Re: How to find the length of a video clip

Postby ojan » 20 Nov 2012, 12:35

Thank you both :-)
I'll give the INFO command a go for now and see what OSC has to offer later on.

Regards
ojan
ojan
 
Posts: 32
Joined: 29 Oct 2012, 08:59

Re: How to find the length of a video clip

Postby vimlesh1975 » 23 Nov 2012, 18:08

tsipas wrote:can anyone managed to get the response from SERVER to HIS CLIENT using the .net dll who delivered from SVT?


CasparDevice.RefreshTemplates() method stores list of templates in CasparDevice.Templates.All

Code: Select all
Sub refreshtemplate()
        lsttemplate.Items.Clear()
        CasparDevice.RefreshTemplates()
        Threading.Thread.Sleep(250)
        For Each File In CasparDevice.Templates.All
            If UCase(File.FullName) Like "*" & UCase(txtsearchtemplate.Text) & "*" Then
                lsttemplate.Items.Add(UCase(Replace((File.FullName), "\", "/")))

            End If
        Next

        lsttemplate.Refresh()
    End Sub



CasparDevice.RefreshMediafiles() method stores the list of clips in CasparDevice.Mediafiles

Code: Select all
Sub refreshclips()
        On Error Resume Next
        lstClips.Items.Clear()
        CasparDevice.RefreshMediafiles()
        Threading.Thread.Sleep(250)
        For Each File In CasparDevice.Mediafiles
            If File.ToString Like "*" & UCase(txtsearch.Text) & "*" Then
                lstClips.Items.Add(Replace(File.ToString, "\", "/"))
            End If
        Next

        lstClips.Refresh()
    End Sub


Both the methods above are from Svt.Caspar.dll
User avatar
vimlesh1975
 
Posts: 599
Joined: 29 Aug 2011, 11:42
Location: Doordarshan, Mumbai, India

Re: How to find the length of a video clip

Postby zbang » 30 Dec 2016, 22:30

Pulling up this old topic because it's relevant-
How accurate are the total frame counts returned by the CINF/INFO commands or in OSC messages?

That is, do they come from a file's metadata, ffmpeg looking at stream timestamps, ffmpeg counting the frames from start, or some other method? I've run into too many cases where the metadata is just wrong (1100 frames for a 28 minute program? I don't think so.) and the only way to get a vaguely accurate numbers was to actually play the file to a null device; not exactly speedy but does the job.

Or, where should I look in the server code for this? (bonus question- are these counts discovered when you play a clip or when the server starts up/notices new files?

Thanks,

z!
zbang
 
Posts: 44
Joined: 10 Apr 2015, 02:09


Return to Tech and Development

Who is online

Users browsing this forum: No registered users and 4 guests