ffmpeg transpose source and scale watermark to fit on different video sizes











up vote
-1
down vote

favorite












I'm using already using the line below to transpose the source, but I'm facing a problem of the watermark being out of proportion when the video resolution is different



How can I make watermark fit on different video sizes?



ffmpeg -i input  -i watermark.png -filter_complex "transpose=1,overlay=-40:300"  -vb 370k -minrate 300k -maxrate 350k -bufsize 350k -aspect "720:1280" -s "360x640" -c:v libx264 -profile:v "Main" -level "3.1" -r 25 -g 25 -keyint_min 50 -x264opts "keyint=50:min-keyint=50:no-scenecut" -c:a aac -strict experimental -b:a 32000 -ar 32000 -ac 1 output









share|improve this question
























  • Sounds frustrating. What questions can we answer for you to help resolve your issue?
    – szatmary
    Nov 9 at 2:07










  • How can I make watermark fit on different video sizes?
    – david
    Nov 9 at 3:04















up vote
-1
down vote

favorite












I'm using already using the line below to transpose the source, but I'm facing a problem of the watermark being out of proportion when the video resolution is different



How can I make watermark fit on different video sizes?



ffmpeg -i input  -i watermark.png -filter_complex "transpose=1,overlay=-40:300"  -vb 370k -minrate 300k -maxrate 350k -bufsize 350k -aspect "720:1280" -s "360x640" -c:v libx264 -profile:v "Main" -level "3.1" -r 25 -g 25 -keyint_min 50 -x264opts "keyint=50:min-keyint=50:no-scenecut" -c:a aac -strict experimental -b:a 32000 -ar 32000 -ac 1 output









share|improve this question
























  • Sounds frustrating. What questions can we answer for you to help resolve your issue?
    – szatmary
    Nov 9 at 2:07










  • How can I make watermark fit on different video sizes?
    – david
    Nov 9 at 3:04













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I'm using already using the line below to transpose the source, but I'm facing a problem of the watermark being out of proportion when the video resolution is different



How can I make watermark fit on different video sizes?



ffmpeg -i input  -i watermark.png -filter_complex "transpose=1,overlay=-40:300"  -vb 370k -minrate 300k -maxrate 350k -bufsize 350k -aspect "720:1280" -s "360x640" -c:v libx264 -profile:v "Main" -level "3.1" -r 25 -g 25 -keyint_min 50 -x264opts "keyint=50:min-keyint=50:no-scenecut" -c:a aac -strict experimental -b:a 32000 -ar 32000 -ac 1 output









share|improve this question















I'm using already using the line below to transpose the source, but I'm facing a problem of the watermark being out of proportion when the video resolution is different



How can I make watermark fit on different video sizes?



ffmpeg -i input  -i watermark.png -filter_complex "transpose=1,overlay=-40:300"  -vb 370k -minrate 300k -maxrate 350k -bufsize 350k -aspect "720:1280" -s "360x640" -c:v libx264 -profile:v "Main" -level "3.1" -r 25 -g 25 -keyint_min 50 -x264opts "keyint=50:min-keyint=50:no-scenecut" -c:a aac -strict experimental -b:a 32000 -ar 32000 -ac 1 output






ffmpeg overlay scaling






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 3:04

























asked Nov 8 at 22:35









david

12




12












  • Sounds frustrating. What questions can we answer for you to help resolve your issue?
    – szatmary
    Nov 9 at 2:07










  • How can I make watermark fit on different video sizes?
    – david
    Nov 9 at 3:04


















  • Sounds frustrating. What questions can we answer for you to help resolve your issue?
    – szatmary
    Nov 9 at 2:07










  • How can I make watermark fit on different video sizes?
    – david
    Nov 9 at 3:04
















Sounds frustrating. What questions can we answer for you to help resolve your issue?
– szatmary
Nov 9 at 2:07




Sounds frustrating. What questions can we answer for you to help resolve your issue?
– szatmary
Nov 9 at 2:07












How can I make watermark fit on different video sizes?
– david
Nov 9 at 3:04




How can I make watermark fit on different video sizes?
– david
Nov 9 at 3:04












1 Answer
1






active

oldest

votes

















up vote
0
down vote













The scale2ref filter is meant for this use case.



-filter_complex "[0]transpose=1[v];[1][v]scale2ref=oh*mdar:ih/8[w][v];[v][w]overlay=X:Y"


The watermark's height will be resized to 1/8th the height of the video. The width will be proportionally resized.






share|improve this answer





















  • Hi thank you so much, how about if I want to add 2 watermarks, but Transpose the input without transposing the two watermarks, Thanks a lot
    – david
    Nov 15 at 17:59











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53217185%2fffmpeg-transpose-source-and-scale-watermark-to-fit-on-different-video-sizes%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













The scale2ref filter is meant for this use case.



-filter_complex "[0]transpose=1[v];[1][v]scale2ref=oh*mdar:ih/8[w][v];[v][w]overlay=X:Y"


The watermark's height will be resized to 1/8th the height of the video. The width will be proportionally resized.






share|improve this answer





















  • Hi thank you so much, how about if I want to add 2 watermarks, but Transpose the input without transposing the two watermarks, Thanks a lot
    – david
    Nov 15 at 17:59















up vote
0
down vote













The scale2ref filter is meant for this use case.



-filter_complex "[0]transpose=1[v];[1][v]scale2ref=oh*mdar:ih/8[w][v];[v][w]overlay=X:Y"


The watermark's height will be resized to 1/8th the height of the video. The width will be proportionally resized.






share|improve this answer





















  • Hi thank you so much, how about if I want to add 2 watermarks, but Transpose the input without transposing the two watermarks, Thanks a lot
    – david
    Nov 15 at 17:59













up vote
0
down vote










up vote
0
down vote









The scale2ref filter is meant for this use case.



-filter_complex "[0]transpose=1[v];[1][v]scale2ref=oh*mdar:ih/8[w][v];[v][w]overlay=X:Y"


The watermark's height will be resized to 1/8th the height of the video. The width will be proportionally resized.






share|improve this answer












The scale2ref filter is meant for this use case.



-filter_complex "[0]transpose=1[v];[1][v]scale2ref=oh*mdar:ih/8[w][v];[v][w]overlay=X:Y"


The watermark's height will be resized to 1/8th the height of the video. The width will be proportionally resized.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 9 at 6:36









Gyan

29.7k22464




29.7k22464












  • Hi thank you so much, how about if I want to add 2 watermarks, but Transpose the input without transposing the two watermarks, Thanks a lot
    – david
    Nov 15 at 17:59


















  • Hi thank you so much, how about if I want to add 2 watermarks, but Transpose the input without transposing the two watermarks, Thanks a lot
    – david
    Nov 15 at 17:59
















Hi thank you so much, how about if I want to add 2 watermarks, but Transpose the input without transposing the two watermarks, Thanks a lot
– david
Nov 15 at 17:59




Hi thank you so much, how about if I want to add 2 watermarks, but Transpose the input without transposing the two watermarks, Thanks a lot
– david
Nov 15 at 17:59


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53217185%2fffmpeg-transpose-source-and-scale-watermark-to-fit-on-different-video-sizes%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Landwehr

Reims

Custom delete method in JpaRepository