I am wondering how I would find out which frame in a video belongs to which audio sample. I was thinking about using ffmpeg. I want to use the information contained in the container to find the solution. In the end I would like to automate the process with C++ but for the beginning I am happy with ffmpeg used by command line.
Lets say: I know audio sample 39822 has the characteristic I am looking for. Using the information contained in the container, I want to find out to which frame the audio sample was recorded. (Key frames/ Samples?)
I was thinking ffmpeg could help me with this problem.
I tried to find the answer within the ffmpeg documentation but did not succeed.
Maybe you guys can give me a hint which tool (maybe even other than ffmpeg) to use or where to look specific.
Thanks in advance Tim
+ Reply to Thread
Results 1 to 9 of 9
Last edited by tim5; 30th Mar 2021 at 08:13.
they are totally independent. you match them by the common time.
audio sample 328165
@ 48kHz samplerate, this is 328165 / 48000 = 6.8367sec
video @ 25FPS (since you're in Deutschland and the math is easier)
25 * 6.8367 = Frame 170.91927, but since there is no such thing as a partial frame, it's just frame 170. Almost 171.
You can use the timestamps for the video and audio chunks. But once again, there isn't a1:1 relationship between video chunks and audio chunks.
So in my head, it depends on the container if such a releation is given or needs to be recreated by the decoder (e.g. re-indexing ).
The question itself about Samples is a little confusing here because it implies that this is about uncompressed audio. Is this given?
Might be better @tim5 if you add some words about the container you are working with?
Last edited by emcodem; 1st Apr 2021 at 03:25.