Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/test_streams.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from fractions import Fraction

import av

from .common import TestCase, fate_suite
Expand Down Expand Up @@ -27,3 +29,21 @@ def test_selection(self):
self.assertEqual([video], container.streams.get(video=(0,)))

# TODO: Find something in the fate suite with video, audio, and subtitles.

def test_stream_properties(self):
# Ensure that all stream properties have sensible values even
# if writing to the stream hasn't started yet
with av.open(self.sandboxed("output.mp4"), "w") as container:
stream = container.add_stream('h264')
assert stream.id is not None
assert stream.profile is None
assert stream.index == 0
assert stream.time_base is None
assert stream.average_rate == Fraction(24, 1)
assert stream.base_rate is None
assert stream.guessed_rate is None
assert stream.start_time is None
assert stream.duration is None
assert stream.frames == 0
assert stream.language is None
assert stream.type == 'video'