Compare commits

...

2 Commits

Author SHA1 Message Date
jlw4049
19ba7a3ad3 refactor: update readme 2024-06-12 01:03:40 -04:00
jlw4049
eee1442bc3 feat: v1.2.1
feat: added '--sub-alignment' arg. This can control the position of the subtitles for everything that isn't a "sync" frame
2024-06-12 01:02:20 -04:00
3 changed files with 18 additions and 13 deletions

@ -5,15 +5,13 @@ A CLI to generate comparison image sets with
## Usage
```
usage: FrameForge [-h] [-v] [--source SOURCE] [--encode ENCODE] [--frames FRAMES]
[--image-dir IMAGE_DIR] [--indexer {lsmash,ffms2}]
[--source-index-path SOURCE_INDEX_PATH]
[--encode-index-path ENCODE_INDEX_PATH] [--sub-size SUB_SIZE]
[--left-crop LEFT_CROP] [--right-crop RIGHT_CROP] [--top-crop TOP_CROP]
[--bottom-crop BOTTOM_CROP] [--adv-resize-left ADV_RESIZE_LEFT]
[--adv-resize-right ADV_RESIZE_RIGHT] [--adv-resize-top ADV_RESIZE_TOP]
[--adv-resize-bottom ADV_RESIZE_BOTTOM] [--tone-map] [--re-sync RE_SYNC]
[--comparison-count COMPARISON_COUNT] [--subtitle-color SUBTITLE_COLOR]
usage: FrameForge [-h] [-v] [--source SOURCE] [--encode ENCODE] [--frames FRAMES] [--image-dir IMAGE_DIR]
[--indexer {lsmash,ffms2}] [--source-index-path SOURCE_INDEX_PATH]
[--encode-index-path ENCODE_INDEX_PATH] [--sub-size SUB_SIZE] [--sub-alignment SUB_ALIGNMENT]
[--left-crop LEFT_CROP] [--right-crop RIGHT_CROP] [--top-crop TOP_CROP] [--bottom-crop BOTTOM_CROP]
[--adv-resize-left ADV_RESIZE_LEFT] [--adv-resize-right ADV_RESIZE_RIGHT]
[--adv-resize-top ADV_RESIZE_TOP] [--adv-resize-bottom ADV_RESIZE_BOTTOM] [--tone-map]
[--re-sync RE_SYNC] [--comparison-count COMPARISON_COUNT] [--subtitle-color SUBTITLE_COLOR]
[--release-sub-title RELEASE_SUB_TITLE]
options:
@ -21,8 +19,7 @@ options:
-v, --version show program's version number and exit
--source SOURCE Path to source file
--encode ENCODE Path to encode file
--frames FRAMES Only use this if you want to specify the frames to generate, this
disables sync frames
--frames FRAMES Only use this if you want to specify the frames to generate, this disables sync frames
--image-dir IMAGE_DIR
Path to base image folder
--indexer {lsmash,ffms2}
@ -32,6 +29,8 @@ options:
--encode-index-path ENCODE_INDEX_PATH
Path to look/create indexes for encode
--sub-size SUB_SIZE Size of subtitles
--sub-alignment SUB_ALIGNMENT
Alignment of subtitles (.ass)
--left-crop LEFT_CROP
Left crop
--right-crop RIGHT_CROP

@ -7,7 +7,7 @@ from frame_forge.cli_utils import frame_list
program_name = "FrameForge"
__version__ = "1.2.0"
__version__ = "1.2.1"
if __name__ == "__main__":
@ -40,6 +40,9 @@ if __name__ == "__main__":
"--encode-index-path", type=str, help="Path to look/create indexes for encode"
)
parser.add_argument("--sub-size", type=int, default=20, help="Size of subtitles")
parser.add_argument(
"--sub-alignment", type=int, default=7, help="Alignment of subtitles (.ass)"
)
parser.add_argument("--left-crop", type=int, help="Left crop")
parser.add_argument("--right-crop", type=int, help="Right crop")
parser.add_argument("--top-crop", type=int, help="Top crop")
@ -114,6 +117,7 @@ if __name__ == "__main__":
source_index_path=args.source_index_path,
encode_index_path=args.encode_index_path,
sub_size=args.sub_size,
sub_alignment=args.sub_alignment,
left_crop=args.left_crop,
right_crop=args.right_crop,
top_crop=args.top_crop,

@ -22,6 +22,7 @@ class GenerateImages:
source_index_path: None | str,
encode_index_path: None | str,
sub_size: int,
sub_alignment: int,
left_crop: int,
right_crop: int,
top_crop: int,
@ -47,6 +48,7 @@ class GenerateImages:
self.source_index_path = source_index_path
self.encode_index_path = encode_index_path
self.sub_size = sub_size
self.sub_alignment = sub_alignment
self.left_crop = left_crop
self.right_crop = right_crop
self.top_crop = top_crop
@ -88,7 +90,7 @@ class GenerateImages:
selected_sub_style = (
f"Segoe UI,{self.sub_size},{color},&H00000000,&H00000000,&H00000000,"
"1,0,0,0,100,100,0,0,1,1,0,7,10,10,10,1"
f"1,0,0,0,100,100,0,0,1,1,0,{self.sub_alignment},10,10,10,1"
)
sync_sub_base = (
"Segoe UI,{size},&H31FF31&,&H00000000,&H00000000,&H00000000,"