Skip to content

Commit

Permalink
Merge pull request #47 from Team-J9/feature/encode
Browse files Browse the repository at this point in the history
일부 동영상이 업로드되지 않는 오류 해결
  • Loading branch information
SJ70 authored Oct 15, 2024
2 parents 094a626 + b19caa9 commit 86e3111
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public enum ImageFileTypes {
private final String contentType;

public static boolean contains(String contentType) {
System.out.println(contentType);
if (contentType == null) {
return false;
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/j9/bestmoments/service/FfmpegService.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public void encodeVideo(String inputFilePath, String outputFilePath, String reso

// 로그 스트림 처리
try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()))) {
String line;
while ((line = reader.readLine()) != null) {
System.out.println(line); // 로그를 출력하거나 저장할 수 있습니다.
}
// String line;
// while ((line = reader.readLine()) != null) {
// log.info(line);
// }
}

int exitCode = process.waitFor();
Expand Down Expand Up @@ -69,7 +69,7 @@ public String getVideoResolution(String inputFilePath) {
// FFmpeg의 출력에서 해상도를 파싱하여 추출
while ((line = reader.readLine()) != null) {
if (line.contains("Video:")) {
String[] parts = line.split(",");
String[] parts = line.split(" ");
for (String part : parts) {
if (part.trim().matches("\\d{2,}x\\d{2,}")) {
resolution = part.trim(); // 해상도 부분을 찾음
Expand Down

0 comments on commit 86e3111

Please sign in to comment.