Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 06-21-2012, 06:40 PM
Elgero Elgero is offline
Senior Member
 
Join Date: Feb 2012
Posts: 177
Elgero is on a distinguished road
Default

Get correct duration while downloading with libRTMP


Hi, does anybody know how to get the correct duration of a stream/video while downloading it with libRTMP? RTMPDump always shows the correct duration, but I don't understand C.

Currently I'm counting the elapsed seconds and in the beginning the counted duration matches the real duration of the stream/video, but after a while it gets 'out of sync'. For example, my application shows 00:45:38, while the real duration of the stream/video being downloaded is 00:45:21.

As far as I could find, RTMP_GetDuration only returns the duration from onMetaData and returns '0' in this case.

Code:
Do Until LibRTMP.RTMP_IsTimedout(r)
    bytes_read = LibRTMP.RTMP_Read(r, b, b.Length)
    If (bytes_read = 0) Then Exit Do
    FS.Write(b, 0, bytes_read)
    ElapsedTime = Duration.Elapsed.TotalSeconds
Loop
Reply With Quote
Reply Post New Thread
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 10:40 PM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons