6 Replies - 663 Views - Last Post: 17 May 2019 - 09:42 AM Rate Topic: -----

#1 chrisjchrisj   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 04-February 19

How can I get these watermarks to scale to fit the video parameters?

Posted 09 May 2019 - 03:22 PM

The ffmpeg works successfully to display watermarks on the video, yet the large watermark image isn't resizing to fit the video screen:

$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';



Any assistance/suggestion is appreciated

Is This A Good Question/Topic? 0
  • +

Replies To: How can I get these watermarks to scale to fit the video parameters?

#2 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3814
  • View blog
  • Posts: 13,870
  • Joined: 08-August 08

Re: How can I get these watermarks to scale to fit the video parameters?

Posted 09 May 2019 - 05:32 PM

Scale the watermark before adding it.
https://www.php.net/....scaleimage.php

This post has been edited by CTphpnwb: 09 May 2019 - 05:32 PM

Was This Post Helpful? 0
  • +
  • -

#3 chrisjchrisj   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 04-February 19

Re: How can I get these watermarks to scale to fit the video parameters?

Posted 09 May 2019 - 07:33 PM

Thanks for your reply and link, but it doesn't appear to be related to ffmpeg.

Any additional help is welcomed
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3814
  • View blog
  • Posts: 13,870
  • Joined: 08-August 08

Re: How can I get these watermarks to scale to fit the video parameters?

Posted 09 May 2019 - 08:27 PM

Is the watermark not an image?
Was This Post Helpful? 0
  • +
  • -

#5 chrisjchrisj   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 04-February 19

Re: How can I get these watermarks to scale to fit the video parameters?

Posted 16 May 2019 - 07:44 AM

Thanks for your reply.
After more research, I believe a potential solutions is to add the 'scale2ref' parameter to my existing ffmpeg code.
I have tried different attempts with it without success. The documentation shows:

“Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio”:
[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]

I need guidance with integrating scale2ref into a current line of code, for example:

$ffmpegCommand =''.$ffmpeg_b.' -y -i '.$video_file_full_path.' -i '.escapeshellarg($watermark_image_full_path).' -i '.escapeshellarg($watermark_image_full_path).' -filter_complex "scale=426:-2,  scale=426:-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_240.' 2>&1';




any assistance is appreciated

This post has been edited by chrisjchrisj: 16 May 2019 - 07:50 AM

Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6252
  • View blog
  • Posts: 24,024
  • Joined: 23-August 08

Re: How can I get these watermarks to scale to fit the video parameters?

Posted 16 May 2019 - 10:37 AM

See also here: https://forums.phpfr...ermark-clarity/
Was This Post Helpful? 1
  • +
  • -

#7 chrisjchrisj   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 04-February 19

Re: How can I get these watermarks to scale to fit the video parameters?

Posted 17 May 2019 - 09:42 AM

Any additional help is appreciated
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1