- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any sample available demonstrating recording and playback code using C# ? In the sdk I see there is a Playback and RecordingDevice classes available.. but couldnt find any example using them.
cheers
Max
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The link below has a long discussion of recording with C#.
https://github.com/IntelRealSense/librealsense/issues/3142
Within that discussion, a RealSense community member posts the script of their solution here:
https://github.com/IntelRealSense/librealsense/issues/3142#issuecomment-465494716
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used the above links to further my work and can successfully record images in *.bag file.
however playback using c# still doesnt seem to work.
Below is my code. For some reasons my playback.Status value is always "Stopped". Any suggestions would be greatly appreciated. Thank you.
var ctx = new Context();
var dev = ctx.AddDevice(@"C:\temp\20190522_133223.bag");
cfg = new Config();
pipeline = new Pipeline(ctx);
var token = tokenSource.Token;
using (pipeline.Start())
using (var playback = PlaybackDevice.FromDevice(dev))
{
Debug.WriteLine(playback.FileName);
playback.Realtime = false;
playback.Resume();
var t = Task.Run(async () =>
{
var start = DateTime.Now;
while (playback.Status == PlaybackStatus.Playing)
{
if (pipeline.PollForFrames(out FrameSet frames))
using (frames)
{
var releaser = new FramesReleaser();
......
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok i found out what was happening here.
The following command adds another device in the list of your devices.
var ctx = new Context();
var dev = ctx.AddDevice(@"C:\temp\My_test100.bag");
Which means if you still have your physical sensor connected then by default when you do:
var pipeline = new Pipeline(ctx);
var pp = pipeline.Start();
This will pick up your physical sensor as the default and attempt to start that pipeline. Which is why I kept getting playback.Status as Stopped.
When I disconnected the sensor from my computer then this code rightly sets up the saved file as a device which you can then start and access frames from.
I can post the whole code if someone wants !
cheers
Max
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello MCC001,
We would like to know if you are still requiring assistance on this matter.
Thank you,
Eliza
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apologies Eliza - I had been away for a while.
But thanks on this particular issue i dont require any support. There is another issue which I'll post soon regarding Playback.
Thanks
Max
![](/skins/images/2F496A9BF2E73260E2FDFDBCABF91248/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page