Keep FFmpeg running
up vote
0
down vote
favorite
Good morning, I have a script that generates 2 images every second in a folder and I want ffmpeg to convert them into a series of mpeg-4 videos of 5 secs duration and that shows 2 images per second (10 frames total). Problem is that after I start the script and after I run ffmpeg, it processes the videos with the images it catches right after I run the command only and then it closes. I tried with the -re command also and nothing happens. How do I keep ffmpeg running and live converting the images while they're being generated? Here's the code I'm using :
ffmpeg -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp -vcodec libx264 -pix_fmt yuv420p -map 0 -segment_time 5 -g 5 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*5)" -f segment C:Desktopoutput%05d.mp4
All I want is to execute ffmpeg one time and let it work and close only when they're finished generating.
video ffmpeg slideshow
New contributor
add a comment |
up vote
0
down vote
favorite
Good morning, I have a script that generates 2 images every second in a folder and I want ffmpeg to convert them into a series of mpeg-4 videos of 5 secs duration and that shows 2 images per second (10 frames total). Problem is that after I start the script and after I run ffmpeg, it processes the videos with the images it catches right after I run the command only and then it closes. I tried with the -re command also and nothing happens. How do I keep ffmpeg running and live converting the images while they're being generated? Here's the code I'm using :
ffmpeg -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp -vcodec libx264 -pix_fmt yuv420p -map 0 -segment_time 5 -g 5 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*5)" -f segment C:Desktopoutput%05d.mp4
All I want is to execute ffmpeg one time and let it work and close only when they're finished generating.
video ffmpeg slideshow
New contributor
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Good morning, I have a script that generates 2 images every second in a folder and I want ffmpeg to convert them into a series of mpeg-4 videos of 5 secs duration and that shows 2 images per second (10 frames total). Problem is that after I start the script and after I run ffmpeg, it processes the videos with the images it catches right after I run the command only and then it closes. I tried with the -re command also and nothing happens. How do I keep ffmpeg running and live converting the images while they're being generated? Here's the code I'm using :
ffmpeg -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp -vcodec libx264 -pix_fmt yuv420p -map 0 -segment_time 5 -g 5 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*5)" -f segment C:Desktopoutput%05d.mp4
All I want is to execute ffmpeg one time and let it work and close only when they're finished generating.
video ffmpeg slideshow
New contributor
Good morning, I have a script that generates 2 images every second in a folder and I want ffmpeg to convert them into a series of mpeg-4 videos of 5 secs duration and that shows 2 images per second (10 frames total). Problem is that after I start the script and after I run ffmpeg, it processes the videos with the images it catches right after I run the command only and then it closes. I tried with the -re command also and nothing happens. How do I keep ffmpeg running and live converting the images while they're being generated? Here's the code I'm using :
ffmpeg -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp -vcodec libx264 -pix_fmt yuv420p -map 0 -segment_time 5 -g 5 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*5)" -f segment C:Desktopoutput%05d.mp4
All I want is to execute ffmpeg one time and let it work and close only when they're finished generating.
video ffmpeg slideshow
video ffmpeg slideshow
New contributor
New contributor
New contributor
asked Nov 14 at 10:08
Vincent Bavaro
12
12
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
Pipe the images. When reading images from files, ffmpeg will identify the last image in the sequence during initialisation and will read till that image.
cat images | ffmpeg -f image2pipe -re -framerate 2 -i - -vcodec libx264 ...
Edit: Not surprisingly cat also sets the input roster at initialisation. However, the method below works for me.
Have the script append the new images to a blob file
i.e. cat new-image >> all-images
while ffmpeg call is
ffmpeg -f image2pipe -re -framerate 2 -i all-images -vcodec libx264 ...
It is very important that your new image generation and appendation speed is equal to or faster than ffmpeg's read speed.
I have Windows, cat won't work. I tried with type but it doesn't work either.
– Vincent Bavaro
Nov 14 at 10:36
Get gow and you'll have cat.
– Gyan
Nov 14 at 10:58
got gow, it gives me this error : C:Desktopinput%05d.bmp: No such file or directory
– Vincent Bavaro
Nov 14 at 11:18
cat *.bmp
works here.
– Gyan
Nov 14 at 11:22
it gives me the same error. Maybe I modified my command in a wrong way? Basically now it goes like : cat *.bmp | ffmpeg -f image2pipe -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp...
– Vincent Bavaro
Nov 14 at 11:28
|
show 8 more comments
up vote
0
down vote
To keep ffmpeg getting added new images, it will need to get them from stdin.
You will need to write a program or script that will keep feeding it new images
as they arrive.
For examples see:
Create video from a growing image sequence using FFMPEG
for a C# script
Use Named Pipe (C++) to send images to FFMPEG
for a C++ program.
These programs will need some changes to fit them to your needs,
but they are a good starting point.
I will try them but I would've liked a built-in ffmpeg solution for it cause adding files to the stdin would slow down the process. I thought the -re command should've worked like that?
– Vincent Bavaro
Nov 14 at 11:36
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
Pipe the images. When reading images from files, ffmpeg will identify the last image in the sequence during initialisation and will read till that image.
cat images | ffmpeg -f image2pipe -re -framerate 2 -i - -vcodec libx264 ...
Edit: Not surprisingly cat also sets the input roster at initialisation. However, the method below works for me.
Have the script append the new images to a blob file
i.e. cat new-image >> all-images
while ffmpeg call is
ffmpeg -f image2pipe -re -framerate 2 -i all-images -vcodec libx264 ...
It is very important that your new image generation and appendation speed is equal to or faster than ffmpeg's read speed.
I have Windows, cat won't work. I tried with type but it doesn't work either.
– Vincent Bavaro
Nov 14 at 10:36
Get gow and you'll have cat.
– Gyan
Nov 14 at 10:58
got gow, it gives me this error : C:Desktopinput%05d.bmp: No such file or directory
– Vincent Bavaro
Nov 14 at 11:18
cat *.bmp
works here.
– Gyan
Nov 14 at 11:22
it gives me the same error. Maybe I modified my command in a wrong way? Basically now it goes like : cat *.bmp | ffmpeg -f image2pipe -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp...
– Vincent Bavaro
Nov 14 at 11:28
|
show 8 more comments
up vote
1
down vote
Pipe the images. When reading images from files, ffmpeg will identify the last image in the sequence during initialisation and will read till that image.
cat images | ffmpeg -f image2pipe -re -framerate 2 -i - -vcodec libx264 ...
Edit: Not surprisingly cat also sets the input roster at initialisation. However, the method below works for me.
Have the script append the new images to a blob file
i.e. cat new-image >> all-images
while ffmpeg call is
ffmpeg -f image2pipe -re -framerate 2 -i all-images -vcodec libx264 ...
It is very important that your new image generation and appendation speed is equal to or faster than ffmpeg's read speed.
I have Windows, cat won't work. I tried with type but it doesn't work either.
– Vincent Bavaro
Nov 14 at 10:36
Get gow and you'll have cat.
– Gyan
Nov 14 at 10:58
got gow, it gives me this error : C:Desktopinput%05d.bmp: No such file or directory
– Vincent Bavaro
Nov 14 at 11:18
cat *.bmp
works here.
– Gyan
Nov 14 at 11:22
it gives me the same error. Maybe I modified my command in a wrong way? Basically now it goes like : cat *.bmp | ffmpeg -f image2pipe -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp...
– Vincent Bavaro
Nov 14 at 11:28
|
show 8 more comments
up vote
1
down vote
up vote
1
down vote
Pipe the images. When reading images from files, ffmpeg will identify the last image in the sequence during initialisation and will read till that image.
cat images | ffmpeg -f image2pipe -re -framerate 2 -i - -vcodec libx264 ...
Edit: Not surprisingly cat also sets the input roster at initialisation. However, the method below works for me.
Have the script append the new images to a blob file
i.e. cat new-image >> all-images
while ffmpeg call is
ffmpeg -f image2pipe -re -framerate 2 -i all-images -vcodec libx264 ...
It is very important that your new image generation and appendation speed is equal to or faster than ffmpeg's read speed.
Pipe the images. When reading images from files, ffmpeg will identify the last image in the sequence during initialisation and will read till that image.
cat images | ffmpeg -f image2pipe -re -framerate 2 -i - -vcodec libx264 ...
Edit: Not surprisingly cat also sets the input roster at initialisation. However, the method below works for me.
Have the script append the new images to a blob file
i.e. cat new-image >> all-images
while ffmpeg call is
ffmpeg -f image2pipe -re -framerate 2 -i all-images -vcodec libx264 ...
It is very important that your new image generation and appendation speed is equal to or faster than ffmpeg's read speed.
edited Nov 15 at 9:35
answered Nov 14 at 10:28
Gyan
13.8k21641
13.8k21641
I have Windows, cat won't work. I tried with type but it doesn't work either.
– Vincent Bavaro
Nov 14 at 10:36
Get gow and you'll have cat.
– Gyan
Nov 14 at 10:58
got gow, it gives me this error : C:Desktopinput%05d.bmp: No such file or directory
– Vincent Bavaro
Nov 14 at 11:18
cat *.bmp
works here.
– Gyan
Nov 14 at 11:22
it gives me the same error. Maybe I modified my command in a wrong way? Basically now it goes like : cat *.bmp | ffmpeg -f image2pipe -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp...
– Vincent Bavaro
Nov 14 at 11:28
|
show 8 more comments
I have Windows, cat won't work. I tried with type but it doesn't work either.
– Vincent Bavaro
Nov 14 at 10:36
Get gow and you'll have cat.
– Gyan
Nov 14 at 10:58
got gow, it gives me this error : C:Desktopinput%05d.bmp: No such file or directory
– Vincent Bavaro
Nov 14 at 11:18
cat *.bmp
works here.
– Gyan
Nov 14 at 11:22
it gives me the same error. Maybe I modified my command in a wrong way? Basically now it goes like : cat *.bmp | ffmpeg -f image2pipe -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp...
– Vincent Bavaro
Nov 14 at 11:28
I have Windows, cat won't work. I tried with type but it doesn't work either.
– Vincent Bavaro
Nov 14 at 10:36
I have Windows, cat won't work. I tried with type but it doesn't work either.
– Vincent Bavaro
Nov 14 at 10:36
Get gow and you'll have cat.
– Gyan
Nov 14 at 10:58
Get gow and you'll have cat.
– Gyan
Nov 14 at 10:58
got gow, it gives me this error : C:Desktopinput%05d.bmp: No such file or directory
– Vincent Bavaro
Nov 14 at 11:18
got gow, it gives me this error : C:Desktopinput%05d.bmp: No such file or directory
– Vincent Bavaro
Nov 14 at 11:18
cat *.bmp
works here.– Gyan
Nov 14 at 11:22
cat *.bmp
works here.– Gyan
Nov 14 at 11:22
it gives me the same error. Maybe I modified my command in a wrong way? Basically now it goes like : cat *.bmp | ffmpeg -f image2pipe -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp...
– Vincent Bavaro
Nov 14 at 11:28
it gives me the same error. Maybe I modified my command in a wrong way? Basically now it goes like : cat *.bmp | ffmpeg -f image2pipe -re -framerate 2 -s 1920x1200 -i C:Desktopinput%05d.bmp...
– Vincent Bavaro
Nov 14 at 11:28
|
show 8 more comments
up vote
0
down vote
To keep ffmpeg getting added new images, it will need to get them from stdin.
You will need to write a program or script that will keep feeding it new images
as they arrive.
For examples see:
Create video from a growing image sequence using FFMPEG
for a C# script
Use Named Pipe (C++) to send images to FFMPEG
for a C++ program.
These programs will need some changes to fit them to your needs,
but they are a good starting point.
I will try them but I would've liked a built-in ffmpeg solution for it cause adding files to the stdin would slow down the process. I thought the -re command should've worked like that?
– Vincent Bavaro
Nov 14 at 11:36
add a comment |
up vote
0
down vote
To keep ffmpeg getting added new images, it will need to get them from stdin.
You will need to write a program or script that will keep feeding it new images
as they arrive.
For examples see:
Create video from a growing image sequence using FFMPEG
for a C# script
Use Named Pipe (C++) to send images to FFMPEG
for a C++ program.
These programs will need some changes to fit them to your needs,
but they are a good starting point.
I will try them but I would've liked a built-in ffmpeg solution for it cause adding files to the stdin would slow down the process. I thought the -re command should've worked like that?
– Vincent Bavaro
Nov 14 at 11:36
add a comment |
up vote
0
down vote
up vote
0
down vote
To keep ffmpeg getting added new images, it will need to get them from stdin.
You will need to write a program or script that will keep feeding it new images
as they arrive.
For examples see:
Create video from a growing image sequence using FFMPEG
for a C# script
Use Named Pipe (C++) to send images to FFMPEG
for a C++ program.
These programs will need some changes to fit them to your needs,
but they are a good starting point.
To keep ffmpeg getting added new images, it will need to get them from stdin.
You will need to write a program or script that will keep feeding it new images
as they arrive.
For examples see:
Create video from a growing image sequence using FFMPEG
for a C# script
Use Named Pipe (C++) to send images to FFMPEG
for a C++ program.
These programs will need some changes to fit them to your needs,
but they are a good starting point.
answered Nov 14 at 11:11
harrymc
247k10256542
247k10256542
I will try them but I would've liked a built-in ffmpeg solution for it cause adding files to the stdin would slow down the process. I thought the -re command should've worked like that?
– Vincent Bavaro
Nov 14 at 11:36
add a comment |
I will try them but I would've liked a built-in ffmpeg solution for it cause adding files to the stdin would slow down the process. I thought the -re command should've worked like that?
– Vincent Bavaro
Nov 14 at 11:36
I will try them but I would've liked a built-in ffmpeg solution for it cause adding files to the stdin would slow down the process. I thought the -re command should've worked like that?
– Vincent Bavaro
Nov 14 at 11:36
I will try them but I would've liked a built-in ffmpeg solution for it cause adding files to the stdin would slow down the process. I thought the -re command should've worked like that?
– Vincent Bavaro
Nov 14 at 11:36
add a comment |
Vincent Bavaro is a new contributor. Be nice, and check out our Code of Conduct.
Vincent Bavaro is a new contributor. Be nice, and check out our Code of Conduct.
Vincent Bavaro is a new contributor. Be nice, and check out our Code of Conduct.
Vincent Bavaro is a new contributor. Be nice, and check out our Code of Conduct.
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%2f1375257%2fkeep-ffmpeg-running%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