Skip to content

Commit

Permalink
Merge pull request #48 from Team-J9/revert-47-feature/encode
Browse files Browse the repository at this point in the history
Revert "일부 동영상이 업로드되지 않는 오류 해결"
  • Loading branch information
SJ70 authored Oct 15, 2024
2 parents 86e3111 + ea85855 commit 0d1f56d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ 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) {
// log.info(line);
// }
String line;
while ((line = reader.readLine()) != null) {
System.out.println(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 0d1f56d

Please sign in to comment.