refactor(directories): switch from File to Path objs
This commit is contained in:
@@ -5,8 +5,8 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -14,15 +14,15 @@ public class ThumbnailService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ThumbnailService.class);
|
||||
|
||||
@Async("ffmpegTaskExecutor")
|
||||
public void createThumbnail(File inputFile, File outputFile, Float timeInVideo) throws IOException, InterruptedException {
|
||||
public void createThumbnail(Path inputFile, Path outputFile, Float timeInVideo) throws IOException, InterruptedException {
|
||||
logger.info("Creating thumbnail at {} seconds", timeInVideo);
|
||||
|
||||
List<String> command = List.of(
|
||||
"ffmpeg",
|
||||
"-ss", timeInVideo.toString(),
|
||||
"-i", inputFile.getAbsolutePath(),
|
||||
"-i", inputFile.toAbsolutePath().toString(),
|
||||
"-frames:v", "1",
|
||||
outputFile.getAbsolutePath()
|
||||
outputFile.toAbsolutePath().toString()
|
||||
);
|
||||
|
||||
CommandRunner.run(command);
|
||||
|
||||
Reference in New Issue
Block a user