ffmpeg image sequence slideshow with fade - missing images?












0















This is using ffmpeg version 3.4.4-0ubuntu0.18.04.1 on Ubuntu 18.04.



I'd like to achieve the same as in Create video with 5 images with fadeIn/out effect in ffmpeg (mostly "Dip to black", although I'd like to know about "Crossfade" too) - however, I have many files, and would prefer to use absolute paths, and I'm afraid I'll run into some command line limitation if I list each file on the command line.



So, I've found this ( the same is noted on ffmpeg slideshow with crossfade ):




  • https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence#Slideshow_with_crossfading_between_the_pictures


... which mentions:




"A" is the duration in seconds how long each picture is shown (without the crossfade duration), and "B" is the crossfade duration in seconds.



ffmpeg -i IMG_%3d.jpg -vf zoompan=d=(A+B)/B:fps=1/B,framerate=25:interp_start=0:interp_end=255:scene=100 -c:v mpeg4 -maxrate 5M -q:v 2 out.mp4



So, i have these images:



$ ls /path/to/test_*.jpg | wc -l
249


I'd like framerate to be 25 fps, duration of each image without fade: quarter second, 0.25 sec (so 6.25 frames, or floored, 6 frames), and fade duration 4 frames (so 0.16 sec @ 25 fps). So I'd expect at least 249*(6+4) = 2490 frames, or 99.6 sec at 25 fps.



This is the format of the images (from a phone camera):



$ mediainfo /path/to/test_IMG_11a.jpg
General
Complete name : /path/to/test_IMG_11a.jpg
Format : JPEG
File size : 1 001 KiB

Image
Format : JPEG
Width : 3 840 pixels
Height : 2 160 pixels
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Compression mode : Lossy
Stream size : 1 001 KiB (100%)


So, I try this command line:



ffmpeg -an -f image2 -pattern_type glob -i '/path/to/test_*.jpg' 
-vf 'fps=25,zoompan=d=(0.25+0.16)/0.16:fps=1/0.16,framerate=25:interp_start=0:interp_end=255:scene=100'
-vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
-y out.mp4


This results with two problems:





The first problem is:



[swscaler @ 0x5582a63a4500] deprecated pixel format used, make sure you did set range correctly
Last message repeated 3 times


While I don't call scale directly, apparently it is implied, because I see in https://trac.ffmpeg.org/wiki/colorspace:




YUV-to-RGB or scaling requires swscale.




The post https://stackoverflow.com/questions/43038294/im-getting-error-deprecated-pixel-format-used-make-sure-you-did-set-range-corr notes this warning can be ignored. However, I'd like to get it right; I've found:




  • [Libav-user] deprecated pixel format used, make sure you did set range correctly



But if you use swscale, you also have to be set the range yourself, or the result will be incorrect.






  • Converting yuvj420p to yuv420p - issues with black levels? : ffmpeg with a "solved" example that uses colorspace


... but I have no idea how to specify colorspace for my images





Second problem: not sure if it is related to the first problem, but the output video as result of the above command stops at frame= 421 - and I can see, most of my 249 images are not encoded! Vlc sees some 16 seconds in the output video - way below the 2490 frames, or 99.6 sec, that I expect.





So, what is the correct command line invocation, to get a slide show from image sequence with fade, without the deprecation warnings and with all images encoded?










share|improve this question


















  • 1





    Remove -pix_fmt yuv420p and place it within your filterchain as the first filter: -vf 'format=yuv420p,.... You may still get the "deprecated pixel format" message that you can ignore, but it will only show up once and not spam the console. I recommend always using format instead of -pix_fmt so you can better control when the format conversion happens in relation to the other filters.

    – llogan
    Jan 18 at 18:25











  • Thanks @llogan - tried that, deprecated pixel format still appears throughout the entire run (though seemingly somewhat less often), and unfortunately the video is still truncated (that is, just 421 frames in output video, instead of expected 2k+)

    – sdaau
    Jan 18 at 20:48











  • Download or compile a recent build.

    – llogan
    Jan 20 at 0:27
















0















This is using ffmpeg version 3.4.4-0ubuntu0.18.04.1 on Ubuntu 18.04.



I'd like to achieve the same as in Create video with 5 images with fadeIn/out effect in ffmpeg (mostly "Dip to black", although I'd like to know about "Crossfade" too) - however, I have many files, and would prefer to use absolute paths, and I'm afraid I'll run into some command line limitation if I list each file on the command line.



So, I've found this ( the same is noted on ffmpeg slideshow with crossfade ):




  • https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence#Slideshow_with_crossfading_between_the_pictures


... which mentions:




"A" is the duration in seconds how long each picture is shown (without the crossfade duration), and "B" is the crossfade duration in seconds.



ffmpeg -i IMG_%3d.jpg -vf zoompan=d=(A+B)/B:fps=1/B,framerate=25:interp_start=0:interp_end=255:scene=100 -c:v mpeg4 -maxrate 5M -q:v 2 out.mp4



So, i have these images:



$ ls /path/to/test_*.jpg | wc -l
249


I'd like framerate to be 25 fps, duration of each image without fade: quarter second, 0.25 sec (so 6.25 frames, or floored, 6 frames), and fade duration 4 frames (so 0.16 sec @ 25 fps). So I'd expect at least 249*(6+4) = 2490 frames, or 99.6 sec at 25 fps.



This is the format of the images (from a phone camera):



$ mediainfo /path/to/test_IMG_11a.jpg
General
Complete name : /path/to/test_IMG_11a.jpg
Format : JPEG
File size : 1 001 KiB

Image
Format : JPEG
Width : 3 840 pixels
Height : 2 160 pixels
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Compression mode : Lossy
Stream size : 1 001 KiB (100%)


So, I try this command line:



ffmpeg -an -f image2 -pattern_type glob -i '/path/to/test_*.jpg' 
-vf 'fps=25,zoompan=d=(0.25+0.16)/0.16:fps=1/0.16,framerate=25:interp_start=0:interp_end=255:scene=100'
-vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
-y out.mp4


This results with two problems:





The first problem is:



[swscaler @ 0x5582a63a4500] deprecated pixel format used, make sure you did set range correctly
Last message repeated 3 times


While I don't call scale directly, apparently it is implied, because I see in https://trac.ffmpeg.org/wiki/colorspace:




YUV-to-RGB or scaling requires swscale.




The post https://stackoverflow.com/questions/43038294/im-getting-error-deprecated-pixel-format-used-make-sure-you-did-set-range-corr notes this warning can be ignored. However, I'd like to get it right; I've found:




  • [Libav-user] deprecated pixel format used, make sure you did set range correctly



But if you use swscale, you also have to be set the range yourself, or the result will be incorrect.






  • Converting yuvj420p to yuv420p - issues with black levels? : ffmpeg with a "solved" example that uses colorspace


... but I have no idea how to specify colorspace for my images





Second problem: not sure if it is related to the first problem, but the output video as result of the above command stops at frame= 421 - and I can see, most of my 249 images are not encoded! Vlc sees some 16 seconds in the output video - way below the 2490 frames, or 99.6 sec, that I expect.





So, what is the correct command line invocation, to get a slide show from image sequence with fade, without the deprecation warnings and with all images encoded?










share|improve this question


















  • 1





    Remove -pix_fmt yuv420p and place it within your filterchain as the first filter: -vf 'format=yuv420p,.... You may still get the "deprecated pixel format" message that you can ignore, but it will only show up once and not spam the console. I recommend always using format instead of -pix_fmt so you can better control when the format conversion happens in relation to the other filters.

    – llogan
    Jan 18 at 18:25











  • Thanks @llogan - tried that, deprecated pixel format still appears throughout the entire run (though seemingly somewhat less often), and unfortunately the video is still truncated (that is, just 421 frames in output video, instead of expected 2k+)

    – sdaau
    Jan 18 at 20:48











  • Download or compile a recent build.

    – llogan
    Jan 20 at 0:27














0












0








0








This is using ffmpeg version 3.4.4-0ubuntu0.18.04.1 on Ubuntu 18.04.



I'd like to achieve the same as in Create video with 5 images with fadeIn/out effect in ffmpeg (mostly "Dip to black", although I'd like to know about "Crossfade" too) - however, I have many files, and would prefer to use absolute paths, and I'm afraid I'll run into some command line limitation if I list each file on the command line.



So, I've found this ( the same is noted on ffmpeg slideshow with crossfade ):




  • https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence#Slideshow_with_crossfading_between_the_pictures


... which mentions:




"A" is the duration in seconds how long each picture is shown (without the crossfade duration), and "B" is the crossfade duration in seconds.



ffmpeg -i IMG_%3d.jpg -vf zoompan=d=(A+B)/B:fps=1/B,framerate=25:interp_start=0:interp_end=255:scene=100 -c:v mpeg4 -maxrate 5M -q:v 2 out.mp4



So, i have these images:



$ ls /path/to/test_*.jpg | wc -l
249


I'd like framerate to be 25 fps, duration of each image without fade: quarter second, 0.25 sec (so 6.25 frames, or floored, 6 frames), and fade duration 4 frames (so 0.16 sec @ 25 fps). So I'd expect at least 249*(6+4) = 2490 frames, or 99.6 sec at 25 fps.



This is the format of the images (from a phone camera):



$ mediainfo /path/to/test_IMG_11a.jpg
General
Complete name : /path/to/test_IMG_11a.jpg
Format : JPEG
File size : 1 001 KiB

Image
Format : JPEG
Width : 3 840 pixels
Height : 2 160 pixels
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Compression mode : Lossy
Stream size : 1 001 KiB (100%)


So, I try this command line:



ffmpeg -an -f image2 -pattern_type glob -i '/path/to/test_*.jpg' 
-vf 'fps=25,zoompan=d=(0.25+0.16)/0.16:fps=1/0.16,framerate=25:interp_start=0:interp_end=255:scene=100'
-vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
-y out.mp4


This results with two problems:





The first problem is:



[swscaler @ 0x5582a63a4500] deprecated pixel format used, make sure you did set range correctly
Last message repeated 3 times


While I don't call scale directly, apparently it is implied, because I see in https://trac.ffmpeg.org/wiki/colorspace:




YUV-to-RGB or scaling requires swscale.




The post https://stackoverflow.com/questions/43038294/im-getting-error-deprecated-pixel-format-used-make-sure-you-did-set-range-corr notes this warning can be ignored. However, I'd like to get it right; I've found:




  • [Libav-user] deprecated pixel format used, make sure you did set range correctly



But if you use swscale, you also have to be set the range yourself, or the result will be incorrect.






  • Converting yuvj420p to yuv420p - issues with black levels? : ffmpeg with a "solved" example that uses colorspace


... but I have no idea how to specify colorspace for my images





Second problem: not sure if it is related to the first problem, but the output video as result of the above command stops at frame= 421 - and I can see, most of my 249 images are not encoded! Vlc sees some 16 seconds in the output video - way below the 2490 frames, or 99.6 sec, that I expect.





So, what is the correct command line invocation, to get a slide show from image sequence with fade, without the deprecation warnings and with all images encoded?










share|improve this question














This is using ffmpeg version 3.4.4-0ubuntu0.18.04.1 on Ubuntu 18.04.



I'd like to achieve the same as in Create video with 5 images with fadeIn/out effect in ffmpeg (mostly "Dip to black", although I'd like to know about "Crossfade" too) - however, I have many files, and would prefer to use absolute paths, and I'm afraid I'll run into some command line limitation if I list each file on the command line.



So, I've found this ( the same is noted on ffmpeg slideshow with crossfade ):




  • https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence#Slideshow_with_crossfading_between_the_pictures


... which mentions:




"A" is the duration in seconds how long each picture is shown (without the crossfade duration), and "B" is the crossfade duration in seconds.



ffmpeg -i IMG_%3d.jpg -vf zoompan=d=(A+B)/B:fps=1/B,framerate=25:interp_start=0:interp_end=255:scene=100 -c:v mpeg4 -maxrate 5M -q:v 2 out.mp4



So, i have these images:



$ ls /path/to/test_*.jpg | wc -l
249


I'd like framerate to be 25 fps, duration of each image without fade: quarter second, 0.25 sec (so 6.25 frames, or floored, 6 frames), and fade duration 4 frames (so 0.16 sec @ 25 fps). So I'd expect at least 249*(6+4) = 2490 frames, or 99.6 sec at 25 fps.



This is the format of the images (from a phone camera):



$ mediainfo /path/to/test_IMG_11a.jpg
General
Complete name : /path/to/test_IMG_11a.jpg
Format : JPEG
File size : 1 001 KiB

Image
Format : JPEG
Width : 3 840 pixels
Height : 2 160 pixels
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Compression mode : Lossy
Stream size : 1 001 KiB (100%)


So, I try this command line:



ffmpeg -an -f image2 -pattern_type glob -i '/path/to/test_*.jpg' 
-vf 'fps=25,zoompan=d=(0.25+0.16)/0.16:fps=1/0.16,framerate=25:interp_start=0:interp_end=255:scene=100'
-vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
-y out.mp4


This results with two problems:





The first problem is:



[swscaler @ 0x5582a63a4500] deprecated pixel format used, make sure you did set range correctly
Last message repeated 3 times


While I don't call scale directly, apparently it is implied, because I see in https://trac.ffmpeg.org/wiki/colorspace:




YUV-to-RGB or scaling requires swscale.




The post https://stackoverflow.com/questions/43038294/im-getting-error-deprecated-pixel-format-used-make-sure-you-did-set-range-corr notes this warning can be ignored. However, I'd like to get it right; I've found:




  • [Libav-user] deprecated pixel format used, make sure you did set range correctly



But if you use swscale, you also have to be set the range yourself, or the result will be incorrect.






  • Converting yuvj420p to yuv420p - issues with black levels? : ffmpeg with a "solved" example that uses colorspace


... but I have no idea how to specify colorspace for my images





Second problem: not sure if it is related to the first problem, but the output video as result of the above command stops at frame= 421 - and I can see, most of my 249 images are not encoded! Vlc sees some 16 seconds in the output video - way below the 2490 frames, or 99.6 sec, that I expect.





So, what is the correct command line invocation, to get a slide show from image sequence with fade, without the deprecation warnings and with all images encoded?







command-line video ffmpeg images






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 18 at 9:51









sdaausdaau

2,44343657




2,44343657








  • 1





    Remove -pix_fmt yuv420p and place it within your filterchain as the first filter: -vf 'format=yuv420p,.... You may still get the "deprecated pixel format" message that you can ignore, but it will only show up once and not spam the console. I recommend always using format instead of -pix_fmt so you can better control when the format conversion happens in relation to the other filters.

    – llogan
    Jan 18 at 18:25











  • Thanks @llogan - tried that, deprecated pixel format still appears throughout the entire run (though seemingly somewhat less often), and unfortunately the video is still truncated (that is, just 421 frames in output video, instead of expected 2k+)

    – sdaau
    Jan 18 at 20:48











  • Download or compile a recent build.

    – llogan
    Jan 20 at 0:27














  • 1





    Remove -pix_fmt yuv420p and place it within your filterchain as the first filter: -vf 'format=yuv420p,.... You may still get the "deprecated pixel format" message that you can ignore, but it will only show up once and not spam the console. I recommend always using format instead of -pix_fmt so you can better control when the format conversion happens in relation to the other filters.

    – llogan
    Jan 18 at 18:25











  • Thanks @llogan - tried that, deprecated pixel format still appears throughout the entire run (though seemingly somewhat less often), and unfortunately the video is still truncated (that is, just 421 frames in output video, instead of expected 2k+)

    – sdaau
    Jan 18 at 20:48











  • Download or compile a recent build.

    – llogan
    Jan 20 at 0:27








1




1





Remove -pix_fmt yuv420p and place it within your filterchain as the first filter: -vf 'format=yuv420p,.... You may still get the "deprecated pixel format" message that you can ignore, but it will only show up once and not spam the console. I recommend always using format instead of -pix_fmt so you can better control when the format conversion happens in relation to the other filters.

– llogan
Jan 18 at 18:25





Remove -pix_fmt yuv420p and place it within your filterchain as the first filter: -vf 'format=yuv420p,.... You may still get the "deprecated pixel format" message that you can ignore, but it will only show up once and not spam the console. I recommend always using format instead of -pix_fmt so you can better control when the format conversion happens in relation to the other filters.

– llogan
Jan 18 at 18:25













Thanks @llogan - tried that, deprecated pixel format still appears throughout the entire run (though seemingly somewhat less often), and unfortunately the video is still truncated (that is, just 421 frames in output video, instead of expected 2k+)

– sdaau
Jan 18 at 20:48





Thanks @llogan - tried that, deprecated pixel format still appears throughout the entire run (though seemingly somewhat less often), and unfortunately the video is still truncated (that is, just 421 frames in output video, instead of expected 2k+)

– sdaau
Jan 18 at 20:48













Download or compile a recent build.

– llogan
Jan 20 at 0:27





Download or compile a recent build.

– llogan
Jan 20 at 0:27










0






active

oldest

votes











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395689%2fffmpeg-image-sequence-slideshow-with-fade-missing-images%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1395689%2fffmpeg-image-sequence-slideshow-with-fade-missing-images%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

Probability when a professor distributes a quiz and homework assignment to a class of n students.

Aardman Animations

Are they similar matrix