Skip to content

Commit

Permalink
Merge pull request #51 from MarcWeberFS:45-fix-deployment-and-check-i…
Browse files Browse the repository at this point in the history
…f-code-runs-on-ec2-instance

Update Dockerfile to set permissions on temp directory and modify FFmpeg command to use absolute paths
  • Loading branch information
MarcWeberFS authored Nov 13, 2024
2 parents 9c8b551 + 6e3e0f1 commit 806d65f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions video-downloader-backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ RUN apt-get update && \
# Set working directory
WORKDIR /app

# Create a temporary directory for file operations
RUN mkdir /app/temp
# Set permissions on the temp directory and its contents
RUN mkdir -p /tmp && chmod 777 /tmp

# Copy the built JAR file into the container
COPY target/*.jar app.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ private void embedSubtitles(String videoFilePath, String srtFilePath, String out
String formattedSrtPath = utf8SrtPath.toString().replace("\\", "/").replace(":", "\\:");

String command = String.format("ffmpeg -i \"%s\" -vf subtitles='%s' -c:a copy \"%s\"",
videoFilePath, formattedSrtPath, outputFilePath);
new File(videoFilePath).getAbsolutePath(),
new File(formattedSrtPath).getAbsolutePath(),
new File(outputFilePath).getAbsolutePath());


System.out.println("Executing FFmpeg command: " + command);

Expand Down

0 comments on commit 806d65f

Please sign in to comment.