|
|
|
@ -264,11 +264,11 @@ def streams(filename):
|
|
|
|
|
|
|
|
|
|
@ffx.command()
|
|
|
|
|
@click.pass_context
|
|
|
|
|
@click.argument('paths', nargs=-1)
|
|
|
|
|
|
|
|
|
|
@click.argument('paths', nargs=-1)
|
|
|
|
|
@click.option('-l', '--label', type=str, default=DEFAULT_LABEL, help='Label to be used as filename prefix')
|
|
|
|
|
|
|
|
|
|
@click.option('-ve', '--video-encoder', type=str, default=DEFAULT_VIDEO_ENCODER, help='Target video encoder (vp9 or av1) default: vp9')
|
|
|
|
|
@click.option('-v', '--video-encoder', type=str, default=DEFAULT_VIDEO_ENCODER, help='Target video encoder (vp9 or av1) default: vp9')
|
|
|
|
|
|
|
|
|
|
@click.option('-q', '--quality', type=str, default=DEFAULT_QUALITY, help='Quality settings to be used with VP9 encoder (default: 23)')
|
|
|
|
|
@click.option('-p', '--preset', type=str, default=DEFAULT_QUALITY, help='Quality preset to be used with AV1 encoder (default: 5)')
|
|
|
|
@ -278,8 +278,11 @@ def streams(filename):
|
|
|
|
|
@click.option('-dts', '--dts-bitrate', type=int, default=DEFAULT_DTS_BANDWIDTH, help='Bitrate in kbit/s to be used to encode 6.1 audio streams')
|
|
|
|
|
|
|
|
|
|
@click.option('-ds', '--default-subtitle', type=int, help='Index of default subtitle stream')
|
|
|
|
|
|
|
|
|
|
@click.option('-fa', '--forced-audio', type=int, help='Index of forced audio stream (including default audio stream tag)')
|
|
|
|
|
@click.option('-da', '--default-audio', type=int, help='Index of default audio stream')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@click.option("--crop", is_flag=False, flag_value="default", default="none")
|
|
|
|
|
|
|
|
|
|
@click.option("-c", "--clear-metadata", is_flag=True, default=False)
|
|
|
|
@ -287,14 +290,14 @@ def streams(filename):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def convert(ctx, paths, label, video_encoder, quality, preset, stereo_bitrate, ac3_bitrate, dts_bitrate, crop, clear_metadata, default_subtitle, default_audio, denoise):
|
|
|
|
|
"""Batch conversion of audiovideo files in format suitable for web playback, e.g. jellyfin
|
|
|
|
|
|
|
|
|
|
startTime = time.perf_counter()
|
|
|
|
|
Files found under PATHS will be converted according to parameters.
|
|
|
|
|
Filename extensions will be changed appropriately.
|
|
|
|
|
Suffices will we appended to filename in case of multiple created files
|
|
|
|
|
or if the filename has not changed."""
|
|
|
|
|
|
|
|
|
|
if len(paths) != 2:
|
|
|
|
|
raise click.BadArgumentUsage(
|
|
|
|
|
'Exactly 2 arguments containing the source file path and target file name must be provided\n'
|
|
|
|
|
'Usage: ffx convert source_path target_filename'
|
|
|
|
|
)
|
|
|
|
|
startTime = time.perf_counter()
|
|
|
|
|
|
|
|
|
|
sourcePath = paths[0]
|
|
|
|
|
targetFilename = paths[1]
|
|
|
|
|