mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-21 15:09:32 +02:00
Adds quality options to video to gif tool
This commit is contained in:
@@ -1,18 +1,21 @@
|
|||||||
|
/* eslint-disable prettier/prettier */
|
||||||
import { Box } from '@mui/material';
|
import { Box } from '@mui/material';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import ToolContent from '@components/ToolContent';
|
import ToolContent from '@components/ToolContent';
|
||||||
import { ToolComponentProps } from '@tools/defineTool';
|
import { ToolComponentProps } from '@tools/defineTool';
|
||||||
import ToolTextInput from '@components/input/ToolTextInput';
|
|
||||||
import ToolTextResult from '@components/result/ToolTextResult';
|
|
||||||
import { GetGroupsType } from '@components/options/ToolOptions';
|
import { GetGroupsType } from '@components/options/ToolOptions';
|
||||||
import { CardExampleType } from '@components/examples/ToolExamples';
|
|
||||||
import { main } from './service';
|
import { main } from './service';
|
||||||
import { InitialValuesType } from './types';
|
import { InitialValuesType } from './types';
|
||||||
import ToolVideoInput from '@components/input/ToolVideoInput';
|
import ToolVideoInput from '@components/input/ToolVideoInput';
|
||||||
import ToolFileResult from '@components/result/ToolFileResult';
|
import ToolFileResult from '@components/result/ToolFileResult';
|
||||||
|
import CheckboxWithDesc from '@components/options/CheckboxWithDesc';
|
||||||
|
import RadioWithTextField from '@components/options/RadioWithTextField';
|
||||||
|
import SimpleRadio from '@components/options/SimpleRadio';
|
||||||
|
|
||||||
const initialValues: InitialValuesType = {
|
const initialValues: InitialValuesType = {
|
||||||
// splitSeparator: '\n'
|
quality: 'mid',
|
||||||
|
fps: '10',
|
||||||
|
scale: 'scale=320:-1:flags=bicubic'
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function VideoToGif({
|
export default function VideoToGif({
|
||||||
@@ -32,8 +35,38 @@ export default function VideoToGif({
|
|||||||
updateField
|
updateField
|
||||||
}) => [
|
}) => [
|
||||||
{
|
{
|
||||||
title: 'Example Settings',
|
title: 'Set Quality',
|
||||||
component: <Box></Box>
|
component: (
|
||||||
|
<Box>
|
||||||
|
<SimpleRadio
|
||||||
|
title="Low"
|
||||||
|
onClick={() => {
|
||||||
|
updateField('quality', 'low');
|
||||||
|
updateField('fps', '5');
|
||||||
|
updateField('scale', 'scale=240:-1:flags=bilinear');
|
||||||
|
}}
|
||||||
|
checked={values.quality === 'low'}
|
||||||
|
/>
|
||||||
|
<SimpleRadio
|
||||||
|
title="Mid"
|
||||||
|
onClick={() => {
|
||||||
|
updateField('quality', 'mid');
|
||||||
|
updateField('fps', '10');
|
||||||
|
updateField('scale', 'scale=320:-1:flags=bicubic');
|
||||||
|
}}
|
||||||
|
checked={values.quality === 'mid'}
|
||||||
|
/>
|
||||||
|
<SimpleRadio
|
||||||
|
title="High"
|
||||||
|
onClick={() => {
|
||||||
|
updateField('quality', 'high');
|
||||||
|
updateField('fps', '15');
|
||||||
|
updateField('scale', 'scale=480:-1:flags=lanczos');
|
||||||
|
}}
|
||||||
|
checked={values.quality === 'high'}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
export type InitialValuesType = {
|
export type InitialValuesType = {
|
||||||
// splitSeparator: string;
|
quality: string;
|
||||||
|
fps: string;
|
||||||
|
scale: string;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user