scale overlay video

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

scale overlay video

Alex Vasilenko
Hello,

Thanks to Liam and Paul now I know how to overlay watermark at the beginning of the video. But there's different problem:
I need to scale watermark width to the video width - 20px. I know it's possible to use movie=watermark, scale=width:height, but the problem is that I don't know the original width/height of the video and there can be other filters that alter source video dimensions (e.g. scale, tranpose).

So the question is: is it possible to get dimensions of different video stream in scale filter?

Thanks in advance,
--
Alex Vasilenko

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: scale overlay video

Liam Condron-Farnos
> So the question is: is it possible to get dimensions of different video stream in scale filter?

I don't think that this is possible, at the moment, with ffmpeg. You
could, of course, script it with your language of choice (probably
involving ffprobe). For example, if you have ffprobe and sed, the
following would get you the width of 'input.file':

ffprobe input.file -show_streams -select_streams v | sed -n '/width=/s/.*=//p'

...put it into a variable & do some basic arithmetic on it, and you
should be able to do what you want.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: scale overlay video

Alex Vasilenko
On Tuesday, March 19, 2013 at 18:33 , Liam Condron-Farnos wrote:
> > So the question is: is it possible to get dimensions of different video stream in scale filter?
>
>
> I don't think that this is possible, at the moment, with ffmpeg. You
> could, of course, script it with your language of choice (probably
> involving ffprobe). For example, if you have ffprobe and sed, the
> following would get you the width of 'input.file':
>
>


Thing is I want to do it in 1 pass to not lose quality on reencoding. I know that I can use lossless encoding and 2 passes but I don't have so much resources.

Paul, will ffmpeg scripting solve my problem?

>
> ffprobe input.file -show_streams -select_streams v | sed -n '/width=/s/.*=//p'
>
> ...put it into a variable & do some basic arithmetic on it, and you
> should be able to do what you want.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email] (mailto:[hidden email])
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
>


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user