-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write our own comptime to deal with ffmpeg 6
- Loading branch information
Showing
5 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
import sys | ||
|
||
def replace_in_file(file_path): | ||
try: | ||
with open(file_path, "r", encoding="utf-8") as file: | ||
content = file.read() | ||
|
||
modified_content = content.replace("# [FFMPEG6] ", "") | ||
|
||
with open(file_path, "w") as file: | ||
file.write(modified_content) | ||
except UnicodeDecodeError: | ||
pass | ||
|
||
|
||
def process_directory(directory): | ||
for root, dirs, files in os.walk(directory): | ||
for file in files: | ||
file_path = os.path.join(root, file) | ||
replace_in_file(file_path) | ||
|
||
if sys.platform == "win32" and sys.argv[1].startswith("6"): | ||
process_directory("av") | ||
process_directory("include") | ||
elif os.environ.get("PYAV_LIBRARY").startswith("ffmpeg-6"): | ||
process_directory("av") | ||
process_directory("include") |