0

The watermark.png is too large for the video. I believed my code has scale code, but I'm not sure why the image doesn't scale down to it.

I've tried adding in scale2ref, but maybe didn't get the image reference correct.

$ffmpegCommand =''.$ffmpeg_b.' -y -i '.$video_file_full_path.' -i '.$watermark_image_full_path.' -i '.$watermark_image_full_path.' -filter_complex "scale=640:-2, scale=640:-2, overlay=10:10, overlay=170:170:enable=between(t\,5\,5+2)" -vcodec libx264 -preset '.$pt->config->convert_speed.' -crf 26 '.$video_output_full_path_360.' 2>&1';

I expected the image to scale according to the current scale=, but the image appears too large

  • you should learn about escapshellarg() asap, you'll run into problems the minute your full file path/filename contains spaces, and the minute a hacker is able to choose the filename, you'll get hacked. but if you'd do `$ffmpegCommand =''.$ffmpeg_b.' -y -i '.escapeshellarg($video_file_full_path).' -i '.escapeshellarg($watermark_image_full_path).' -i '.escapeshellarg($watermark_image_full_path)`, you'd be safe – hanshenrik May 08 '19 at 18:59
  • Much thanks for your reply. I can see how that would be important, and will add that. It doesn't, however, seem to pertain to the scaling issue. Any other answers will be welcomed. – chrisjchrisj May 09 '19 at 17:22

0 Answers0