I have some TV recordings in MPEG-2 Transport Stream format
[url removed, login to view]
The recordings are using standard 188-bytes packets.
I need a C/C++ function, which reads the recording file and finds first I frame (key frame) position.
The function will accept two parameters:
- file pointer "fp"
- unsigned integer with seek position "pos"
The function will seek in the file pointer "fp" to the position "pos" (SEEK_SET), and will read the packets until key frame in the video is found. When found, the function returns unsigned integer - the absolute position of the key frame.
The seek position "pos" passed to the function will always be a position of packet header start (byte G). Thus it will always be a multiply of 188.
You can't use any third party libraries for this (e.g. ffmpeg). You must read the raw file data and you must analyze it on your own. The reason is that your C code will be reimplemented later to a different programming language which doesn't have any such libraries.
Example file uploaded to the project as "[url removed, login to view]"
Hello, I believe you know that MPEG-TS can carry more than one program which means multiple video streams. So Let me check you sample file then I will let you know. Best regards, Amir
9 freelancers are bidding on average $162 for this job
Hello! I've done similar work some time ago. As I remember it was fast converter of TS stream from TCP to UDP. I've worked with TS structures in that activity. I think I could write such function for you.