added todos

This commit is contained in:
Daniel Tsvetkov 2020-09-06 20:56:06 +02:00
parent 6643959596
commit fc4af8cc9c
2 changed files with 12 additions and 2 deletions

View File

@ -16,7 +16,7 @@
3. Times and tries best to arrange the timestamps of the two subtitle files to match 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) 4. Stops and lets the user fix (see `fix.txt` below)
5. If the `fix.txt` file exists, it assumes times have been fixed 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 7. Concatenates the final video with title of variable `FINAL_TITLE` and clears up temp files
### `fix.txt` ### `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 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

View File

@ -4,7 +4,7 @@ import textwrap
from common import run_os_cmd from common import run_os_cmd
from compare import linear_compare 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" FINAL_TITLE = "strange_stars"
DE_VIDEO = "https://www.youtube.com/watch?v=-1FvAEaE0fc" DE_VIDEO = "https://www.youtube.com/watch?v=-1FvAEaE0fc"
EN_VIDEO = "https://www.youtube.com/watch?v=p_8yK2kmxoo" EN_VIDEO = "https://www.youtube.com/watch?v=p_8yK2kmxoo"