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

Correction of FrameUtility #46

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ce369c9
Convert ms to ass timestamp like aegisub
moi15moi Aug 27, 2022
e74cb27
Add Time and Timecode object
moi15moi Aug 27, 2022
5dbdce3
Adapt the FrameUtility to Timecode object
moi15moi Aug 27, 2022
43aa8d2
Import Time and Timecode module in __init__.py
moi15moi Aug 27, 2022
4f7b995
Remove old code
moi15moi Aug 27, 2022
29f0853
Format code with Black
moi15moi Aug 28, 2022
20788fa
Add the possibility that the first line contain "# timecode format v2\n"
moi15moi Aug 28, 2022
b389ddf
Add files to be able to test the new Timecodes feature
moi15moi Aug 28, 2022
f86cf2b
Update test_ms_to_frames and test_frames_to_ms
moi15moi Aug 28, 2022
850a45e
Format timecodes msg exception
moi15moi Aug 29, 2022
1e7fed4
Add test_validate_timecodes
moi15moi Aug 29, 2022
c73a288
Add Timecodes constructor (from_fps, from_mkv, from_timestamps_file) …
moi15moi Aug 29, 2022
1dc0e24
Change // to int()
moi15moi Aug 29, 2022
df1ebb4
Correct the indentation and update the .ass file so that we can test …
moi15moi Aug 29, 2022
190a186
Created new timestamps module to handle timestamps creation/verificat…
CoffeeStraw Aug 30, 2022
8864055
Use pytest instead of pytest_check to test_validate_timecodes
moi15moi Aug 30, 2022
56b6efe
Merge branch 'master' of https://github.com/moi15moi/PyonFX
CoffeeStraw Aug 30, 2022
8001f83
Merge branch 'master' of https://github.com/moi15moi/PyonFX
CoffeeStraw Aug 30, 2022
18de5f8
Formatted with black
CoffeeStraw Aug 30, 2022
1bd9cc9
Correct comment link
moi15moi Aug 30, 2022
524aafd
Remove unusued import
moi15moi Aug 30, 2022
8a306e3
Correct an error in the last merge
moi15moi Aug 30, 2022
078c7a6
Add test when all the timestamps are identical
moi15moi Aug 30, 2022
567c48d
[pyonfx\timestamps.py] Add return type and change some comment
moi15moi Aug 30, 2022
3d3f158
[pyonfx\convert.py] Remove unusued import
moi15moi Aug 30, 2022
3ce9698
[pyonfx\convert.py] Update the comment
moi15moi Aug 30, 2022
dd03078
Correct timestamps file name for the .ass file
moi15moi Aug 30, 2022
a90c0ed
Test the end_time for test_ms_to_frames() AND test_frames_to_ms()
moi15moi Aug 30, 2022
75da47e
Add EXACT in Enum TimeType
moi15moi Aug 30, 2022
63d4bf1
Format with black and unnecessary parenthesis removal
moi15moi Aug 30, 2022
6b99249
Remove test_move_ms_to_frame()
moi15moi Aug 30, 2022
7e0a6f9
Better way to verify if an time_type is from TimeType Enum
moi15moi Aug 30, 2022
d4bbd20
Change ValueError to TypeError
moi15moi Aug 30, 2022
088c32c
Change examples to make them work with the new FrameUtility
moi15moi Aug 30, 2022
a704a14
Remove default value for time_type in move_ms_to_frame()
moi15moi Aug 31, 2022
e5d3884
Remove del video_source. It is useless
moi15moi Sep 1, 2022
7fe956f
Updated documentation and docstrings
CoffeeStraw Sep 4, 2022
f3b7208
Create tests\test_timestamps.py
moi15moi Sep 4, 2022
dc306a4
Add test_move_ms_to_frame
moi15moi Sep 6, 2022
9085c6f
Rename time_stamps to timestamps and black format
moi15moi Sep 6, 2022
0aaff86
[test_move_ms_to_frame] Compare ms instead of ass timestamp
moi15moi Sep 6, 2022
2441653
Replace pyffms2 by decord
moi15moi Oct 8, 2022
8d684b4
mp4 file have many different of signature. Now, we only check the mim…
moi15moi Oct 8, 2022
4ecbe59
Add some test for timestamps
moi15moi Oct 8, 2022
545fb88
[test_from_video_file] Add test with mkv file and avi file
moi15moi Oct 8, 2022
cfa373f
Add a class for Timestamps
moi15moi Nov 26, 2022
3b55e1b
Correct implementation of the new class Timestamps
moi15moi Nov 26, 2022
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: 6 additions & 1 deletion examples/2 - Beginner/2 - Utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
io = Ass("in.ass")
meta, styles, lines = io.get_data()

# Let's load the timestamps
timestamps_list = from_timestamps_file("timestamps.txt")


def romaji(line, l):
for syl in Utils.all_non_empty(line.syls):
Expand All @@ -44,7 +47,9 @@ def romaji(line, l):
# Main Effect
# Let's create a FrameUtility object and set up a radius for the random positions
FU = FrameUtility(
line.start_time + syl.start_time, line.start_time + syl.end_time
line.start_time + syl.start_time,
line.start_time + syl.end_time,
timestamps_list,
)
radius = 2

Expand Down
11 changes: 9 additions & 2 deletions examples/2 - Beginner/3 - Variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
star = Shape.star(5, 4, 10)
CU = ColorUtility(lines)

# Let's load the timestamps
timestamps_list = from_timestamps_file("timestamps.txt")


def romaji(line, l):
# Setting up a delay, we will use it as duration time of the leadin and leadout effects
Expand Down Expand Up @@ -107,7 +110,9 @@ def romaji(line, l):
# Jump-in to the first syl
jump_height = 18
if syl.i == 0:
FU = FrameUtility(line.start_time - line.leadin / 2, line.start_time)
FU = FrameUtility(
line.start_time - line.leadin / 2, line.start_time, timestamps_list
)
for s, e, i, n in FU:
l.start_time = s
l.end_time = e
Expand All @@ -133,7 +138,9 @@ def romaji(line, l):
else syl.width
)
FU = FrameUtility(
line.start_time + syl.start_time, line.start_time + syl.end_time
line.start_time + syl.start_time,
line.start_time + syl.end_time,
timestamps_list,
)
for s, e, i, n in FU:
l.start_time = s
Expand Down
Loading