Comments (7)
I think this could be done. A timecode is available from each received video frame. I have not studied the details of timecodes, but in this plugin you would retrieve it in ofxReceiveImage.cpp > ReceiveImage at line 1139 as the "timecode of the frame in 100-nanosecond intervals".
int64_t timecode = video_frame.timecode;
For a receiver, there is also "video_frame.timestamp" generated by the SDK when the frame is produced by the sender and this is documented in "Processing.NDI.structs.h". The SDK documentation explains more about the timecode value, time since epoch etc..
from ofxndi.
Hi @leadedge,
I'm involved in a project where accessing timestamp and timecode information is essential. In using the ofxNDI addon for openFrameworks, I noticed that the various ReceiveImage
methods (whether they take a buffer, texture, or FBO) do not inherently provide this data.
To work around this, I've experimented by modifying these methods, such as changing ReceiveImage(ofPixels &buffer)
to ReceiveImage(ofPixels &buffer, int64_t ×tamp)
. This allows the optional retrieval of timestamp information along with the video data. While this modification meets my immediate needs, it made me wonder about the broader utility of such a feature in the addon.
Do you think it would be beneficial to integrate optional timecode and timestamp retrieval capabilities into the ReceiveImage
methods? This addition could be designed to maintain backward compatibility, ensuring it doesn't disrupt existing implementations. If you see merit in this suggestion, I would be glad to open a new issue to discuss these enhancements in more detail.
Thank you for considering this proposal.
Best regards,
Eduard
from ofxndi.
Thanks Eduard,
I am sure that somebody like @moebiussurfing would be very interested.
This project is actually a double wrapper. The ofxNDIsend / ofxNDIreceive classes can be used independently of Openframeworks, so that would be something to consider.
Initially I would see some additional function like "GetTimeCode", that works in the same way as "GetMetadataString".
Right now I am knee deep, or more likely neck deep, in several other things so can't do anything immediately but I would be interested to have a look at what you have done.
from ofxndi.
I have modified the separate sender and receiver to make them a single project. Documentation is still not updated. The sender-receiver example has a define in ofApp.h #define BUILDRECEIVER
. Enable the define for a receiver and disable for a sender.
I will put the sender-receiver-example source in a "src" folder. Meanwhile it's outside that but still in the sender-receiver folder. Copy those files to your Openframeworks src folder.
Tomorrow I will add "GetVideoTimestamp()" and test it with the receiver example and come back.
from ofxndi.
The NDI video frame structure allows for a timecode, but this is not set from a timing source. The timecode value is set to the default (synthesised for us).
from ofxndi.
Thanks!
So I’m trying to sync a tracker with an ndi feed. Right now the ndi feed comes in after the tracking data. I’d like to keep a timecode referenced buffer of tracking data, check the ndi frame timecode, find that frames tracking data from the buffer, and reemit them both in sync.
Do you think this is possible?
from ofxndi.
Hi @Leadge, I needed timestamp and not timecode for my use case. So I just added timestamp retrieval the same way you implemented timecode information in a pull request.
My use case is receiving 120fps NDI frames from a camera, and storing it in a pool where I can retrieve the frames based on the timestamp information to create timed video effects.
My implementation is as follows:
int64_t t1;
int64_t t2;
int64_t t3;
int numframes = 0;
if (ndiReceiver.ReceiveImage(pix1)) {
t1 = ndiReceiver.GetVideoTimestamp();
ndiTex1.loadData(pix1);
output = &ndiTex1;
timestamp1 = t1;
}
if (ndiReceiver.ReceiveImage(pix2)) {
t2 = ndiReceiver.GetVideoTimestamp();
ndiTex2.loadData(pix2);
output2 = &ndiTex2;
timestamp2 = t2;
}
if (ndiReceiver.ReceiveImage(pix3)) {
t3 = ndiReceiver.GetVideoTimestamp();
ndiTex3.loadData(pix3);
output3 = &ndiTex3;
timestamp3 = t3;
}
I wanted to update the receiver example to retreive that information, but last commit seems the example is gone, and there is a non-working sender-reveiver example (does not have sources inside src/
folder, and does not have a receiver implemented inside the code. Or I amb missing something.
Thanks for all your efforts on improving the library!
Eduard
from ofxndi.
Related Issues (20)
- undeclared identifiers on OSX HOT 4
- Issues when compiling for macOs and Linux HOT 8
- EXC_BAD_ACCESS when building for macOS (Release only, Debug works) HOT 19
- Proper way to handle multiple receivers HOT 3
- Issues with CopyMemory and unsigned __int32 on macOs HOT 10
- Memory leak on mac osx HOT 12
- macOs - freezing for about 10 seconds when NDI sender is disconnected HOT 5
- RPI 4 support (OpenGL ES 2.0) HOT 2
- ofxNDIutils, rgba_bgra and rgba_bgra_sse2 don't compile in macOS HOT 6
- README could be commented... HOT 11
- macOS errors HOT 10
- ndiSender.GetNDIversion() crashes in macOS HOT 5
- ofmain.h HOT 4
- should it be possible to send two NDI streams from the same openframeworks app ? HOT 2
- reference to 'byte' is ambiguous when compiling example using msys2 HOT 10
- Failing to compile latest commit on macOS HOT 9
- not working in macOS HOT 14
- error when compiling example on raspberry pi 4: undefined reference to ofxNDIutils::CopyImage HOT 8
- not working in macOS 2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofxndi.