GithubHelp home page GithubHelp logo

gopro / gpmf-write Goto Github PK

View Code? Open in Web Editor NEW
51.0 63.0 17.0 138 KB

General Purpose Metadata Format (GPMF™) writing tools like that use within GoPro® cameras.

License: Apache License 2.0

CMake 0.77% C 99.23%

gpmf-write's People

Contributors

0dan0 avatar ddennedy-gpsw avatar dnewman-gpsw avatar erlenner avatar flupke avatar kgurganus-gpfw avatar lbrownell-gpsw avatar tcheema-gpsw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gpmf-write's Issues

[Question] Recommended means of multiplexing GPMF data in an mp4

Thanks for the nice project. I am interested in storing timed metadata alongside video data in a fragmented mp4 file (fragmentation is for tolerance to sudden failure during encoding, say running out of disk space or software crash). GPMF looks great for the metadata side.

While I understand from the README and a previously closed issue (#1) that robust multiplexing of GPMF data in an mp4 is out of scope for this library, I would be interested to learn what the recommended way of doing so would be.

I looked at ffmpeg / libav so far but haven't managed to create a data track in an mp4 with it yet. The closest I got is to do it in a mov file (I haven't started the GPMF part not the fragmentation part yet):
https://gist.github.com/tvercaut/890c9c78159189d685f9f9911a098278
See also a related email thread here: http://ffmpeg.org/pipermail/libav-user/2022-March/013041.html and http://ffmpeg.org/pipermail/libav-user/2022-April/013043.html

Given the ffmpeg bug report below, I am wondering if ffmpeg / libav is a viable option for my need:
https://trac.ffmpeg.org/ticket/8338

I have been looking at other options but haven't found something ideal yet. I have seen the following:

Write GPMF data to an MP4 file

Would it be possible to provide demo code of actually writing GPMF data to an MP4 file in a new or existing "GoPro MET" track? Or at the very least write the GPMF data to a binary file that can then be multiplexed after-the-fact into an MP4 using ffmpeg?

It is not very clear what GPMF_demo.c is actually doing since it's not writing either to an MP4 file or even a simple file, from what I can gather it is writing in-memory to a buffer.

Can't set time values by GPMFWriteStreamStoreStamped() when using more than 2 sensors

Hi, I'm trying to make a gpmf mp4 file using pre-existing sensor data (e.g. GPS, Accelerometer, Gyroscope).
By using for loops for each sensors, I succeeded in putting the streams of three sensors in one file, but the rest of the streams except the first stream did not contain the time(cts) value I put in the GPMFWriteStreamStoreStamped(...,tick) function. Actually, there were cts data such as 4004, 5005, 6006.
Is there any way to solve this problem?

GPS写入

您好,请问这个项目可以往视频中写入GPS经度和纬度信息吗?如果可以,请问这个信息是写在了哪里?

Structs that have characters or unsigned 8-bit ints in them result in a write error

This struct will results in an error code 5 if you send it to GPMFWriteStreamStore

#define STRUCT_KEY "Ffc"

typedef struct{
    uint32_t test;
    float f;
    char c;
}test_struct_t;

This one runs fine:

#define STRUCT_KEY "Ff"

typedef struct{
    uint32_t test;
    float f;
}test_struct_t;

Structs containing a uint8_t have the same error, I haven't tested with all the possible datatypes.

[Bug] Export is hanging when enabling flag GPMF_FLAGS_STORE_ALL_TIMESTAMPS

I have tested the library on a Linux x86 setup and built with given instructions.
It seems that enabling this flag is stucking the program execution.

Here is the function used that is causing the hang.

GPMFWriteStreamStoreStamped(handleB, STR2FOURCC("SnrB"), GPMF_TYPE_FLOAT, sizeof(float), samples, &testValue, GPMF_FLAGS_STORE_ALL_TIMESTAMPS, tick);

It seems related to an internal interlock issue.

[Question] Writing GPMF data on Android

Hi,

Please forgive me if I do not use the GitHub Issue system correctly as I have never used features like theses on GitHub.

We are trying to use this gpmf-write library on Android. First we wrote a POC project on Windows that uses this gpmf-writer library on Windows (on X64 CPU) to add fake GPS ("GPS5" and "GPSU") data to an MP4 video file using FFMPEG. We use CMake for our build and have CMake download the library from GitHub and build it as a dependency of our project. Our POC seems to work as expected. We did notice that for some reason the order in which different data is fed to the library using GPMFWriteStreamStore seems to matter but if we got the order correctly the output video could succesfully be read by "exiftool -ee <videoname.mp4>".

Now we have ported this code to Android. It basically does the same thing but then with real GPS data. On Android we have a 64-bit ARM CPU. For some reason we get lots of SIGSEG's and SIGBUS'es. It seems to happen when the GPMFWriteStreamStore call is made to add the "GPSU" data. We only put one sample of five int32_t's in one call at a time. The memory that contains our GPS data is allocated using posix_memalign and is aligned at multiples of sizeof(void*). After the call, the memory is freed using free() as it should be according to the documentation of posix_memalign. We noticed that the SIGSEG's and SIGBUS'es would not happen if we do a memset before supplying the data to the library. So somehow the contents of the data seem to matter (this is not behavior I would expect).

Could you please help us find out what the issue could be here? Could it be an endianness thing? Or a memory alignment thing?
Any help would be greatly appreciated.

Thanks in advance,

Raymon @ SmartDelta

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.