Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expect PyAV is not compiled with experimental codecs #657

Merged
merged 1 commit into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions auto_editor/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def media_length(self) -> int:

with av.open(self.src.path, "r") as container:
audio_stream = container.streams.audio[0]
self.log.experimental(audio_stream.codec)
result = sum(1 for _ in iter_audio(audio_stream, self.tb))

self.log.debug(f"Audio Length: {result}")
Expand Down Expand Up @@ -263,9 +262,6 @@ def audio(self, stream: int) -> NDArray[np.float32]:
container = av.open(self.src.path, "r")
audio = container.streams.audio[stream]

if audio.codec.experimental:
self.log.error(f"`{audio.codec.name}` is an experimental codec")

if audio.duration is not None and audio.time_base is not None:
inaccurate_dur = int(audio.duration * audio.time_base * self.tb)
elif container.duration is not None:
Expand Down Expand Up @@ -304,9 +300,6 @@ def motion(self, stream: int, blur: int, width: int) -> NDArray[np.float32]:
container = av.open(self.src.path, "r")
video = container.streams.video[stream]

if video.codec.experimental:
self.log.experimental(video.codec)

inaccurate_dur = (
1024
if video.duration is None or video.time_base is None
Expand Down
2 changes: 0 additions & 2 deletions auto_editor/cmds/levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def main(sys_args: list[str] = sys.argv[1:]) -> None:
else:
container = av.open(src.path, "r")
audio_stream = container.streams.audio[obj["stream"]]
log.experimental(audio_stream.codec)

values = []

Expand All @@ -158,7 +157,6 @@ def value_storing_generator() -> Iterator[np.float32]:
else:
container = av.open(src.path, "r")
video_stream = container.streams.video[obj["stream"]]
log.experimental(video_stream.codec)

values = []

Expand Down
11 changes: 1 addition & 10 deletions auto_editor/utils/log.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
from __future__ import annotations

import sys
from datetime import timedelta
from shutil import get_terminal_size, rmtree
from tempfile import mkdtemp
from time import perf_counter, sleep
from typing import TYPE_CHECKING, NoReturn

if TYPE_CHECKING:
import av
from typing import NoReturn


class Log:
Expand Down Expand Up @@ -100,10 +95,6 @@ def stop_timer(self) -> None:

sys.stdout.write(f"Finished. took {second_len} seconds ({minute_len})\n")

def experimental(self, codec: av.Codec) -> None:
if codec.experimental:
self.error(f"`{codec.name}` is an experimental codec")

@staticmethod
def deprecated(message: str) -> None:
sys.stderr.write(f"\033[1m\033[33m{message}\033[0m\n")
Expand Down