Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· openaiHugging Face Suzhen/CodeChat

"ffmpeg -framerate 60 -i %d.png -c:v proresks -profile:v 4 -tune:v animation -pixfmt…

  1. User

    "ffmpeg -framerate 60 -i %d.png -c:v prores_ks -profile:v 4 -tune:v animation -pix_fmt yuva444p10le -vendor ap10 -compression_level 0 z.mov". The PNGS are in 1980x1080, I want the final video to be 1280x720. How do I change the command to let that happen

  2. Assistant

    To change the resolution of the output video to 1280x720, you can modify the given FFmpeg command as follows:

    ffmpeg -framerate 60 -i %d.png -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" -c:v prores_ks -profile:v 4 -tune:v animation -pix_fmt yuva444p10le -vendor ap10 -compression_level 0 z.mov
    

    Explanation of the added argument:

    • -vf is used to apply video filters. In this case, it consists of two filters: scale and pad.
    • scale=1280:720:force_original_aspect_ratio=decrease scales the input frames to a width of 1280 and a height of 720. force_original_aspect_ratio=decrease ensures that the aspect ratio is maintained.
    • pad=1280:720:(ow-iw)/2:(oh-ih)/2 pads the scaled video by adding black borders if necessary. It ensures the final output video has the exact resolution of 1280x720. (ow-iw)/2 and (oh-ih)/2 calculate the corresponding offset to center the video.

    By using these filters, any input video resolution will be automatically scaled to 1280x720 while preserving the aspect ratio.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.