Skip to content

[FEAT] add iter() to audio, video, and media modules #58

Description

@tikuma-lsuhsc

Currently, read() routines in these modules retrieve the data at once, and streaming access uses open() but the latter requires several lines of code to set up. Look into adding iter() routines to simplify the streaming read interface, e.g.,

video:

import ffmpegio as ff

for frame in ff.video.iter('video.mp4'):
   ... # work with video frame data, one at a time

audio:

for frame in ff.audio.iter('audio.mp3', frame_size=1024):
   ... # work with audio samples, 1024 samples at a time

media (each stream may not have data available simultaneously):

for vframe, aframe in ff.media.iter('video.mp3', streams=['v:0','a:0']):
    if vframe is not None:
       ... # work with video frame
    if aframe is not None:
       ... # work with audio samples roughly associated with one video frame

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions