FFmpeg: Masking webcam while recording
I hope you're all having a great day.
I'm trying to record a webcam that is shaped as a rounded-rectangular on the top-right of the screen.
I'm using this mask
The shape of the webcam in the video is actually the same as the mask but the problem is that it can only record the first frame then the webcam freezes until the end of the video.
ffmpeg -f gdigrab -s 1360x768 -framerate 30 -i desktop
-f dshow -i video="webcam-device":audio="audio-input-device"
-filter_complex "movie='roundedrectangle.png',alphaextract[a];[1:v][a]alphamerge,scale=256:-1[cutout];[0:v][cutout]overlay=10:10,split=2[output0][output1]"
-map 1:a -c:a aac -map "[output0]" -c:v libx264 -b:v 2M -preset fast -s 1280x720 -f mp4 output0.mp4
-map 1:a -c:a aac -map "[output1]" -c:v libx264 -b:v 2M -preset fast -s 1280x720 -f mp4 output1.mp4
Expected output: Two videos with sound that got a rounded-rectangular webcam on the top left of the screen.
Thank you so much.
ffmpeg mask
add a comment |
I hope you're all having a great day.
I'm trying to record a webcam that is shaped as a rounded-rectangular on the top-right of the screen.
I'm using this mask
The shape of the webcam in the video is actually the same as the mask but the problem is that it can only record the first frame then the webcam freezes until the end of the video.
ffmpeg -f gdigrab -s 1360x768 -framerate 30 -i desktop
-f dshow -i video="webcam-device":audio="audio-input-device"
-filter_complex "movie='roundedrectangle.png',alphaextract[a];[1:v][a]alphamerge,scale=256:-1[cutout];[0:v][cutout]overlay=10:10,split=2[output0][output1]"
-map 1:a -c:a aac -map "[output0]" -c:v libx264 -b:v 2M -preset fast -s 1280x720 -f mp4 output0.mp4
-map 1:a -c:a aac -map "[output1]" -c:v libx264 -b:v 2M -preset fast -s 1280x720 -f mp4 output1.mp4
Expected output: Two videos with sound that got a rounded-rectangular webcam on the top left of the screen.
Thank you so much.
ffmpeg mask
add a comment |
I hope you're all having a great day.
I'm trying to record a webcam that is shaped as a rounded-rectangular on the top-right of the screen.
I'm using this mask
The shape of the webcam in the video is actually the same as the mask but the problem is that it can only record the first frame then the webcam freezes until the end of the video.
ffmpeg -f gdigrab -s 1360x768 -framerate 30 -i desktop
-f dshow -i video="webcam-device":audio="audio-input-device"
-filter_complex "movie='roundedrectangle.png',alphaextract[a];[1:v][a]alphamerge,scale=256:-1[cutout];[0:v][cutout]overlay=10:10,split=2[output0][output1]"
-map 1:a -c:a aac -map "[output0]" -c:v libx264 -b:v 2M -preset fast -s 1280x720 -f mp4 output0.mp4
-map 1:a -c:a aac -map "[output1]" -c:v libx264 -b:v 2M -preset fast -s 1280x720 -f mp4 output1.mp4
Expected output: Two videos with sound that got a rounded-rectangular webcam on the top left of the screen.
Thank you so much.
ffmpeg mask
I hope you're all having a great day.
I'm trying to record a webcam that is shaped as a rounded-rectangular on the top-right of the screen.
I'm using this mask
The shape of the webcam in the video is actually the same as the mask but the problem is that it can only record the first frame then the webcam freezes until the end of the video.
ffmpeg -f gdigrab -s 1360x768 -framerate 30 -i desktop
-f dshow -i video="webcam-device":audio="audio-input-device"
-filter_complex "movie='roundedrectangle.png',alphaextract[a];[1:v][a]alphamerge,scale=256:-1[cutout];[0:v][cutout]overlay=10:10,split=2[output0][output1]"
-map 1:a -c:a aac -map "[output0]" -c:v libx264 -b:v 2M -preset fast -s 1280x720 -f mp4 output0.mp4
-map 1:a -c:a aac -map "[output1]" -c:v libx264 -b:v 2M -preset fast -s 1280x720 -f mp4 output1.mp4
Expected output: Two videos with sound that got a rounded-rectangular webcam on the top left of the screen.
Thank you so much.
ffmpeg mask
ffmpeg mask
asked Dec 11 at 15:18
Sano
73
73
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
alphamerge terminates with the shortest input and your 2nd input is a single frame. So you need to loop it.
movie='roundedrectangle.png':loop=0,alphaextract[a];
Good lord this is the third time you help me out, I'm feeling embarrassed :') Thank you so much
– Sano
Dec 12 at 9:01
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1382664%2fffmpeg-masking-webcam-while-recording%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
alphamerge terminates with the shortest input and your 2nd input is a single frame. So you need to loop it.
movie='roundedrectangle.png':loop=0,alphaextract[a];
Good lord this is the third time you help me out, I'm feeling embarrassed :') Thank you so much
– Sano
Dec 12 at 9:01
add a comment |
alphamerge terminates with the shortest input and your 2nd input is a single frame. So you need to loop it.
movie='roundedrectangle.png':loop=0,alphaextract[a];
Good lord this is the third time you help me out, I'm feeling embarrassed :') Thank you so much
– Sano
Dec 12 at 9:01
add a comment |
alphamerge terminates with the shortest input and your 2nd input is a single frame. So you need to loop it.
movie='roundedrectangle.png':loop=0,alphaextract[a];
alphamerge terminates with the shortest input and your 2nd input is a single frame. So you need to loop it.
movie='roundedrectangle.png':loop=0,alphaextract[a];
answered Dec 11 at 17:05
Gyan
14.5k21644
14.5k21644
Good lord this is the third time you help me out, I'm feeling embarrassed :') Thank you so much
– Sano
Dec 12 at 9:01
add a comment |
Good lord this is the third time you help me out, I'm feeling embarrassed :') Thank you so much
– Sano
Dec 12 at 9:01
Good lord this is the third time you help me out, I'm feeling embarrassed :') Thank you so much
– Sano
Dec 12 at 9:01
Good lord this is the third time you help me out, I'm feeling embarrassed :') Thank you so much
– Sano
Dec 12 at 9:01
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1382664%2fffmpeg-masking-webcam-while-recording%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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