Replies: 5 comments 21 replies
-
|
Ok, it seems that with ffmpegio.open(str(input_path), "rvv", map=["0:0", "0:1", "0:2"], blocksize=1) as fin:
# ... returns dictionary with `v:0`, `v:1` and `v:2`But now the resulting video streams are not encoded the correct way. Is it possible to specify different encodings per stream? I think it should be possible using the |
Beta Was this translation helpful? Give feedback.
-
|
@cansik - FYI, just released v0.9.0, which includes the fix. Give it a try! |
Beta Was this translation helpful? Give feedback.
-
|
One other thing is the internal queue size. By default, the queue size is set to infinite so that the reader's thread can take every frame ffmpeg produces as fast as possible and shove it in the queue for the main thread to retrieve the frames. This however is bloats the memory footprint unnecessary when your processing speed is far slower. Though undocumented, you can set the queue size in the constructor for the multi-stream reader (and only multi-stream reader for now). For example, with ff.open(str(input_path), "rvv", map=streams, blocksize=1, queuesize=6) as fin:
...This effectively gives you a double buffer (you're reading 3 frames per block from 3 streams) so the reader thread can stuff the queue one block ahead of your main process. You can make it larger as you wish. But I'd keep it at minimum double the number of frames that you are reading at a time. |
Beta Was this translation helpful? Give feedback.
-
|
@tikuma-lsuhsc Thanks again for your help, I finally managed to release the library: https://github.com/cansik/open-azure-kinect There are still a few things I wanted to ask you, mainly regarding searching and timecode retrieval.
|
Beta Was this translation helpful? Give feedback.
-
I don't see any frame metadata embedded in any of the video streams in But, I can postulate where to find this information. The main video stream is encoded in Motion JPEG which is an intraframe-compression (de fact) "standard" so it stores a sequence of JPEG images with their capture time slapped on as their labels. As such, it supports non-uniform frame rates. Moreover, the time base of the stream is 1e6 (frame time is counted in 1-us interval, which corresponds to your description of the expected timecode resolution. So, the bottom line is use tlabel = 'best_effort_timestamp_time'
t = np.array(
[
f[tlabel]
for f in ff.probe.frames(
input_path, streams="v:0", entries=["best_effort_timestamp_time"]
)
]
)The safest field to get the time is If you want to see other fields, run ff.probe.frames(input_path, streams="v:0", intervals=1)to get the info of the first frame. ( |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
I have an Azure Kinect MKV file which I would like to extract frames from. The file contains a RGB video stream (
rgb24) and twogray16lestreams for the IR and Depth values. In the documentation I have read that withvvit would be possible to read all video streams, but it seems that only the RGB stream is extracted. Or I use themap=0:1method to extract a specific stream.How is it possible to read all streams at once?
Attached: test.mkv
Beta Was this translation helpful? Give feedback.
All reactions