FFMPEG: change input without stoping proccess
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
how i can change input on ffmpeg without stop process on linux Debian 9? im user decklink input and i need to change to file mp4 input.
ffmpeg -f decklink -i 'DeckLink Mini Recorder' -vf setpts=PTS-STARTPTS -pix_fmt uyvy422 -s 1920x1080 -r 25000/1000 -f decklink 'DeckLink Mini Monitor'
linux python video ffmpeg
add a comment |Â
up vote
0
down vote
favorite
how i can change input on ffmpeg without stop process on linux Debian 9? im user decklink input and i need to change to file mp4 input.
ffmpeg -f decklink -i 'DeckLink Mini Recorder' -vf setpts=PTS-STARTPTS -pix_fmt uyvy422 -s 1920x1080 -r 25000/1000 -f decklink 'DeckLink Mini Monitor'
linux python video ffmpeg
ffmpeg can't reconfigure input mid-process.
â Gyan
Jul 11 at 5:22
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
how i can change input on ffmpeg without stop process on linux Debian 9? im user decklink input and i need to change to file mp4 input.
ffmpeg -f decklink -i 'DeckLink Mini Recorder' -vf setpts=PTS-STARTPTS -pix_fmt uyvy422 -s 1920x1080 -r 25000/1000 -f decklink 'DeckLink Mini Monitor'
linux python video ffmpeg
how i can change input on ffmpeg without stop process on linux Debian 9? im user decklink input and i need to change to file mp4 input.
ffmpeg -f decklink -i 'DeckLink Mini Recorder' -vf setpts=PTS-STARTPTS -pix_fmt uyvy422 -s 1920x1080 -r 25000/1000 -f decklink 'DeckLink Mini Monitor'
linux python video ffmpeg
asked Jul 10 at 22:23
admin883
6
6
ffmpeg can't reconfigure input mid-process.
â Gyan
Jul 11 at 5:22
add a comment |Â
ffmpeg can't reconfigure input mid-process.
â Gyan
Jul 11 at 5:22
ffmpeg can't reconfigure input mid-process.
â Gyan
Jul 11 at 5:22
ffmpeg can't reconfigure input mid-process.
â Gyan
Jul 11 at 5:22
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
For any other person looking forward to this answer I got to the following solution (using python and CV2):
STEP 1:
Run your camera (or any other ffmpeg input) live locally
ffmpeg -i /dev/video0 -b 50k -r 20 -s 720x480 -f mpegts udp://127.0.0.1:2000
STEP 2:
Have the ad or video you want to be displayed with the resolution as your input and most importantly saved as a .3gp video file.
STEP 3: Write a switcher.py file in the same directory as your .3gp file
import cv2
import sys
def main(argv):
adName = argv[0]
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 2
while cap.isOpened():
if showAd == 1:
cap.release()
del cap
cap = cv2.VideoCapture(adName)
showAd = 0
if showAd == 2:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 0
ret, frame = cap.read()
try:
height, width, channels = frame.shape
except:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
key = cv2.waitKey(33)
if key==27:
showAd = 1
if key==32:
showAd = 2
if(ret):
sys.stdout.write(frame.tostring())
cv2.imshow("frame",frame)
cap.release()
if __name__ == "__main__":
main(sys.argv[1:])
STEP 5: Run the switcher.py with your ad name afterward and your output.
python switcher.py ad.3gp| ffplay -f rawvideo -pixel_format bgr24 -video_size 720x480 -i -
STEP 6:
Hit "Esc" to show your ad!
REMEMBER TO CHANGE THE SCREEN VALUES!
Hope I've helped someone! (Probably I'll do some edits to this post)
add a comment |Â
up vote
0
down vote
Hmmm, I can't understand your question very well...
If you are having problems in using DeckLink and ffmpeg those website might be useful:
https://www.ffmpeg.org/ffmpeg-devices.html#decklink
https://trac.ffmpeg.org/wiki/Capture/Blackmagic
If you are trying to switch from one DeckLink to a camera or other recording device, then I'm afraid to say you will need to code a "switcher" (probably, if streaming, the stream is going to stop). If you need any help with the coding e-mail me! (I don't have enough reputation to comment)
yes. i need switch input wihout going to stop. where ur email i can see?
â admin883
Jul 11 at 9:10
@admin883 gustavomperedo@gmail.com
â Gustavo Machado
Jul 11 at 12:45
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
For any other person looking forward to this answer I got to the following solution (using python and CV2):
STEP 1:
Run your camera (or any other ffmpeg input) live locally
ffmpeg -i /dev/video0 -b 50k -r 20 -s 720x480 -f mpegts udp://127.0.0.1:2000
STEP 2:
Have the ad or video you want to be displayed with the resolution as your input and most importantly saved as a .3gp video file.
STEP 3: Write a switcher.py file in the same directory as your .3gp file
import cv2
import sys
def main(argv):
adName = argv[0]
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 2
while cap.isOpened():
if showAd == 1:
cap.release()
del cap
cap = cv2.VideoCapture(adName)
showAd = 0
if showAd == 2:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 0
ret, frame = cap.read()
try:
height, width, channels = frame.shape
except:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
key = cv2.waitKey(33)
if key==27:
showAd = 1
if key==32:
showAd = 2
if(ret):
sys.stdout.write(frame.tostring())
cv2.imshow("frame",frame)
cap.release()
if __name__ == "__main__":
main(sys.argv[1:])
STEP 5: Run the switcher.py with your ad name afterward and your output.
python switcher.py ad.3gp| ffplay -f rawvideo -pixel_format bgr24 -video_size 720x480 -i -
STEP 6:
Hit "Esc" to show your ad!
REMEMBER TO CHANGE THE SCREEN VALUES!
Hope I've helped someone! (Probably I'll do some edits to this post)
add a comment |Â
up vote
1
down vote
For any other person looking forward to this answer I got to the following solution (using python and CV2):
STEP 1:
Run your camera (or any other ffmpeg input) live locally
ffmpeg -i /dev/video0 -b 50k -r 20 -s 720x480 -f mpegts udp://127.0.0.1:2000
STEP 2:
Have the ad or video you want to be displayed with the resolution as your input and most importantly saved as a .3gp video file.
STEP 3: Write a switcher.py file in the same directory as your .3gp file
import cv2
import sys
def main(argv):
adName = argv[0]
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 2
while cap.isOpened():
if showAd == 1:
cap.release()
del cap
cap = cv2.VideoCapture(adName)
showAd = 0
if showAd == 2:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 0
ret, frame = cap.read()
try:
height, width, channels = frame.shape
except:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
key = cv2.waitKey(33)
if key==27:
showAd = 1
if key==32:
showAd = 2
if(ret):
sys.stdout.write(frame.tostring())
cv2.imshow("frame",frame)
cap.release()
if __name__ == "__main__":
main(sys.argv[1:])
STEP 5: Run the switcher.py with your ad name afterward and your output.
python switcher.py ad.3gp| ffplay -f rawvideo -pixel_format bgr24 -video_size 720x480 -i -
STEP 6:
Hit "Esc" to show your ad!
REMEMBER TO CHANGE THE SCREEN VALUES!
Hope I've helped someone! (Probably I'll do some edits to this post)
add a comment |Â
up vote
1
down vote
up vote
1
down vote
For any other person looking forward to this answer I got to the following solution (using python and CV2):
STEP 1:
Run your camera (or any other ffmpeg input) live locally
ffmpeg -i /dev/video0 -b 50k -r 20 -s 720x480 -f mpegts udp://127.0.0.1:2000
STEP 2:
Have the ad or video you want to be displayed with the resolution as your input and most importantly saved as a .3gp video file.
STEP 3: Write a switcher.py file in the same directory as your .3gp file
import cv2
import sys
def main(argv):
adName = argv[0]
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 2
while cap.isOpened():
if showAd == 1:
cap.release()
del cap
cap = cv2.VideoCapture(adName)
showAd = 0
if showAd == 2:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 0
ret, frame = cap.read()
try:
height, width, channels = frame.shape
except:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
key = cv2.waitKey(33)
if key==27:
showAd = 1
if key==32:
showAd = 2
if(ret):
sys.stdout.write(frame.tostring())
cv2.imshow("frame",frame)
cap.release()
if __name__ == "__main__":
main(sys.argv[1:])
STEP 5: Run the switcher.py with your ad name afterward and your output.
python switcher.py ad.3gp| ffplay -f rawvideo -pixel_format bgr24 -video_size 720x480 -i -
STEP 6:
Hit "Esc" to show your ad!
REMEMBER TO CHANGE THE SCREEN VALUES!
Hope I've helped someone! (Probably I'll do some edits to this post)
For any other person looking forward to this answer I got to the following solution (using python and CV2):
STEP 1:
Run your camera (or any other ffmpeg input) live locally
ffmpeg -i /dev/video0 -b 50k -r 20 -s 720x480 -f mpegts udp://127.0.0.1:2000
STEP 2:
Have the ad or video you want to be displayed with the resolution as your input and most importantly saved as a .3gp video file.
STEP 3: Write a switcher.py file in the same directory as your .3gp file
import cv2
import sys
def main(argv):
adName = argv[0]
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 2
while cap.isOpened():
if showAd == 1:
cap.release()
del cap
cap = cv2.VideoCapture(adName)
showAd = 0
if showAd == 2:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
showAd = 0
ret, frame = cap.read()
try:
height, width, channels = frame.shape
except:
cap.release()
del cap
cap = cv2.VideoCapture("udp://127.0.0.1:2000")
key = cv2.waitKey(33)
if key==27:
showAd = 1
if key==32:
showAd = 2
if(ret):
sys.stdout.write(frame.tostring())
cv2.imshow("frame",frame)
cap.release()
if __name__ == "__main__":
main(sys.argv[1:])
STEP 5: Run the switcher.py with your ad name afterward and your output.
python switcher.py ad.3gp| ffplay -f rawvideo -pixel_format bgr24 -video_size 720x480 -i -
STEP 6:
Hit "Esc" to show your ad!
REMEMBER TO CHANGE THE SCREEN VALUES!
Hope I've helped someone! (Probably I'll do some edits to this post)
answered Jul 20 at 20:43
Gustavo Machado
183
183
add a comment |Â
add a comment |Â
up vote
0
down vote
Hmmm, I can't understand your question very well...
If you are having problems in using DeckLink and ffmpeg those website might be useful:
https://www.ffmpeg.org/ffmpeg-devices.html#decklink
https://trac.ffmpeg.org/wiki/Capture/Blackmagic
If you are trying to switch from one DeckLink to a camera or other recording device, then I'm afraid to say you will need to code a "switcher" (probably, if streaming, the stream is going to stop). If you need any help with the coding e-mail me! (I don't have enough reputation to comment)
yes. i need switch input wihout going to stop. where ur email i can see?
â admin883
Jul 11 at 9:10
@admin883 gustavomperedo@gmail.com
â Gustavo Machado
Jul 11 at 12:45
add a comment |Â
up vote
0
down vote
Hmmm, I can't understand your question very well...
If you are having problems in using DeckLink and ffmpeg those website might be useful:
https://www.ffmpeg.org/ffmpeg-devices.html#decklink
https://trac.ffmpeg.org/wiki/Capture/Blackmagic
If you are trying to switch from one DeckLink to a camera or other recording device, then I'm afraid to say you will need to code a "switcher" (probably, if streaming, the stream is going to stop). If you need any help with the coding e-mail me! (I don't have enough reputation to comment)
yes. i need switch input wihout going to stop. where ur email i can see?
â admin883
Jul 11 at 9:10
@admin883 gustavomperedo@gmail.com
â Gustavo Machado
Jul 11 at 12:45
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Hmmm, I can't understand your question very well...
If you are having problems in using DeckLink and ffmpeg those website might be useful:
https://www.ffmpeg.org/ffmpeg-devices.html#decklink
https://trac.ffmpeg.org/wiki/Capture/Blackmagic
If you are trying to switch from one DeckLink to a camera or other recording device, then I'm afraid to say you will need to code a "switcher" (probably, if streaming, the stream is going to stop). If you need any help with the coding e-mail me! (I don't have enough reputation to comment)
Hmmm, I can't understand your question very well...
If you are having problems in using DeckLink and ffmpeg those website might be useful:
https://www.ffmpeg.org/ffmpeg-devices.html#decklink
https://trac.ffmpeg.org/wiki/Capture/Blackmagic
If you are trying to switch from one DeckLink to a camera or other recording device, then I'm afraid to say you will need to code a "switcher" (probably, if streaming, the stream is going to stop). If you need any help with the coding e-mail me! (I don't have enough reputation to comment)
answered Jul 11 at 1:03
Gustavo Machado
183
183
yes. i need switch input wihout going to stop. where ur email i can see?
â admin883
Jul 11 at 9:10
@admin883 gustavomperedo@gmail.com
â Gustavo Machado
Jul 11 at 12:45
add a comment |Â
yes. i need switch input wihout going to stop. where ur email i can see?
â admin883
Jul 11 at 9:10
@admin883 gustavomperedo@gmail.com
â Gustavo Machado
Jul 11 at 12:45
yes. i need switch input wihout going to stop. where ur email i can see?
â admin883
Jul 11 at 9:10
yes. i need switch input wihout going to stop. where ur email i can see?
â admin883
Jul 11 at 9:10
@admin883 gustavomperedo@gmail.com
â Gustavo Machado
Jul 11 at 12:45
@admin883 gustavomperedo@gmail.com
â Gustavo Machado
Jul 11 at 12:45
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454580%2fffmpeg-change-input-without-stoping-proccess%23new-answer', 'question_page');
);
Post as a guest
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
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
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
ffmpeg can't reconfigure input mid-process.
â Gyan
Jul 11 at 5:22