LEADTOOLS Support
General
General Questions
Capture live stream and split in multiple files
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, February 28, 2012 11:22:50 PM(UTC)
Groups: Registered
Posts: 16
Hi,
I'm capturing a live stream using IltmmCapture object. Next step is to write the stream to disk in multiple files with the length of x minutes.
Does someone knows how I can do that? Maybe there is a Callback option for this.
Thanks,
Jelle
#2
Posted
:
Wednesday, February 29, 2012 7:10:05 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You should look at the ProgressEvent for the capture object. The time event arg tells you how much time has elapsed. You could monitor that, and after a certain amount of time you could stop the recording, change the target file, and the restart the recording. I've attached a sample c# file that demonstrates how to do this. It's roughly based on our Capture tutorial:
http://www.leadtools.com/help/leadtools/v175/dh/multimedia/to/leadtools.topics.multimedia~leadtools.topics.multimedia.creatingamultimediacaptureapplication.html
I don't know if you need the files to be seamless. If that's the case, you might want to consider using our DVR Module as it's designed to better handle tasks like that:
http://www.leadtools.com/help/leadtools/v175/dh/multimedia/to/leadtools.topics.multimedia~leadtools.topics.multimedia.introductiontotheleadtoolsdvrmodule.html
#3
Posted
:
Thursday, March 1, 2012 7:05:47 AM(UTC)
Groups: Registered
Posts: 16
It is an option to use the time event, but I think I will loose some data from the live stream.
I looked at the dvr module, but it is writing not in the correct format. I want .ts files with a sequence number.
Is there not a option to overload writing of the file or create my own implementation.
Thanks,
Jelle Vreeker
#4
Posted
:
Friday, March 2, 2012 7:34:20 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I think you're best option if you're trying to not lose data is to either use the DVR Module with the TargetFormat set to DVRTransport. Then you could periodically use the CopyBufferToFile method of the DVR Sink to create the TS files you want.
http://www.leadtools.com/help/leadtools/v175/multimedia/api/dllc_/howtocopybuffereddvrdatatoanewfilec++.htm
http://www.leadtools.com/help/leadtools/v175/multimedia/api/ilmdvrsource/ilmdvrsource__copybuffertofile.htm
Or you could use a convert control with the sel. start and sel. end settings to convert just a specific portion of your DVR buffer to the ts files.
#5
Posted
:
Tuesday, March 6, 2012 6:22:15 AM(UTC)
Groups: Registered
Posts: 16
It is now working with the dvrsink and the copyBuffertofile function.
I'm using the IltmmConvert object for recieving a udp/rtsp stream.
Now I need to know when I recieved x minutes of video. In the IltmmCapture I can use setNotifyWindow and then get
ltmmCapture_Notify_Progress with time in lparam.
Is there something for IltmmConvert, with ltmmConvert_Notify_Progress I only get the percentage.
#6
Posted
:
Tuesday, March 6, 2012 9:12:14 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
One option that might work is to use the GetStatus method of the DVR Sink:
http://www.leadtools.com/help/leadtools/v175/multimedia/api/ilmdvrsink/ilmdvrsink__getstatus.htm
If you know the bitrate your video is recording at, you could periodically check the Recording Size parameter. If the size is larger than the equivalent file size of however many minutes you're trying to split the files at(multiplied by whatever index you're at), you could call copy buffer at that point. There are some other similar methods as well for the DVR Sink:
http://www.leadtools.com/help/leadtools/v175/multimedia/api/ilmdvrsink/ilmdvrsinkinterface.htm
You could also use the Windows Timer class and start it once the conversion begins, but I don't think that'd be as exact you'd like.
LEADTOOLS Support
General
General Questions
Capture live stream and split in multiple files
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.