File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 77from ._core import VideoStreamMetadata
88from ._video_decoder import VideoDecoder # noqa
99
10- # from ._audio_decoder import AudioDecoder # Will be public when more stable
11-
1210SimpleVideoDecoder = VideoDecoder
Original file line number Diff line number Diff line change @@ -70,8 +70,6 @@ int getNumChannels(const AVFrame* avFrame) {
7070}
7171
7272int getNumChannels (const UniqueAVCodecContext& avCodecContext) {
73- // Not sure about the exactness of the version bounds, but as long as this
74- // compile we're fine.
7573#if LIBAVFILTER_VERSION_MAJOR > 8 || \
7674 (IBAVFILTER_VERSION_MAJOR == 8 && LIBAVFILTER_VERSION_MINOR >= 44 )
7775 return avCodecContext->ch_layout .nb_channels ;
Original file line number Diff line number Diff line change 1919)
2020
2121
22- # TODO-audio: docs below are mostly for video streams.
22+ # TODO-audio: docs below are mostly for video streams, we should edit them and /
23+ # or make sure they're OK for audio streams as well. Not sure how to best handle
24+ # docs for such class hierarchy.
2325@dataclass
2426class StreamMetadata :
2527 duration_seconds_from_header : Optional [float ]
@@ -154,6 +156,8 @@ def __repr__(self):
154156
155157@dataclass
156158class AudioStreamMetadata (StreamMetadata ):
159+ """Metadata of a single audio stream."""
160+
157161 # TODO-AUDIO do we expose the notion of frame here, like in fps? It's technically
158162 # valid, but potentially is an FFmpeg-specific concept for audio
159163 # TODO-AUDIO Need sample rate and format and num_channels
Original file line number Diff line number Diff line change @@ -400,7 +400,7 @@ def test_audio_get_json_metadata(self):
400400 decoder = create_from_file (str (NASA_AUDIO .path ))
401401 metadata = get_json_metadata (decoder )
402402 metadata_dict = json .loads (metadata )
403- assert metadata_dict ["durationSeconds" ] == pytest .approx (13.013 , abs = 0.01 )
403+ assert metadata_dict ["durationSeconds" ] == pytest .approx (13.248 , abs = 0.01 )
404404
405405 def test_get_ffmpeg_version (self ):
406406 ffmpeg_dict = get_ffmpeg_library_versions ()
You can’t perform that action at this time.
0 commit comments