From fc4af8cc9c6d83e3d39594a3e87019cbf3d5397a Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Sun, 6 Sep 2020 20:56:06 +0200 Subject: [PATCH] added todos --- README.md | 12 +++++++++++- main.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3eb1600..0b05762 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ 3. Times and tries best to arrange the timestamps of the two subtitle files to match 4. Stops and lets the user fix (see `fix.txt` below) 5. If the `fix.txt` file exists, it assumes times have been fixed - 6. Cuts the scenes defined in `fix.txt` and then combines them in `'EN'+'DE'+'EN'` form + 6. Cuts the scenes defined in `fix.txt` and then combines them in `'EN'+'DE'+'EN'` form and puts subtitle text in the middle of the screen 7. Concatenates the final video with title of variable `FINAL_TITLE` and clears up temp files ### `fix.txt` @@ -61,3 +61,13 @@ Title in scene 2 is in two lines in English Title in scene 2 in German is in one line ``` + +## TODO: +* The cmd interface could be better - perhaps provide a first argument the name of the video and then store the metadata in `data/video_title/data.py` or similar (see the current `data/strange_stars` for inspiration). + - This could provide caches e.g. for `fix.txt` and other intermediate files +* **HUGE assumption** here is that the videos are of the roughly same length, quality and resolution - there have been no tests for boundary conditions too outside of these assumptions + - E.g. videos are assumed to be `.mp4` when downloading with worst quality - this may fail because mp4 is hardcoded in the commands (even though ffmpeg will probably be able to merge different formats, it will fail on different resolution/quality) +* Linear sync is uuuuugly (and thus by default not used at all right now). It's trying to find the matching frame linearly searching from -5 to +5 seconds with a constant step on `de_video` from a 0th point of the `en_video`. The idea is to syncronize the frames which should maybe provide a bettwr guide to subtitle aligment. Much better would a variant of binary search algo with varying step alternating on left/right side or a gradient descent-like. + - Further, generating images, saving them, comparing the save and saving on disk is very naive and also slow - maybe come up with a faster method to compare frames overall +* Concatenating of DE+EN+DE and then putting over subtitles (step 6. above) is currently two ffmpeg commands while it could be one + - Further, both steps 6. and 7. could be optimized/combined with some advanced ffmpeg-magic \ No newline at end of file diff --git a/main.py b/main.py index f75eadf..f090940 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,7 @@ import textwrap from common import run_os_cmd from compare import linear_compare -# TODO: AMMEND THESE FOR NOW - should become cmdline params +# TODO: AMMEND THESE FOR NOW - should become cmdline params / text file FINAL_TITLE = "strange_stars" DE_VIDEO = "https://www.youtube.com/watch?v=-1FvAEaE0fc" EN_VIDEO = "https://www.youtube.com/watch?v=p_8yK2kmxoo"