VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. hi all,

    i have 399 consecutive jpeg files. i want to make a video from them. i use the follwing command:
    ffmpeg -f image2 -i image%d.jpg video.mp4

    there is no problem in the progress. total length is 15-16 seconds. however video is too fast compared to real life. i tried to reduce fps to get a longer video using the following command (1 fps, just to test):
    ffmpeg -f image2 -i image%d.jpg -r 1 video.mp4

    nevertheless it just uses first 18-19 images to create a 18 seconds long video... it shows 1 image for 1 second but its length is not 399 seconds as expected in this try. since i don't know much about the mechanism of such things, i think i am missing something. so what is that? show me the light
    Quote Quote  
  2. strange enough, there is no answer such questions... i wonder why?
    Quote Quote  
  3. Member bat999's Avatar
    Join Date
    Feb 2008
    Location
    United Kingdom
    Search Comp PM
    Hi
    This is from the ffmpeg documentation.
    Here:- http://www.ffmpeg.org/ffmpeg-doc.html
    Maybe you need to modify your command.

    For creating a video from many images:

    Code:
     ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
    The syntax foo-%03d.jpeg specifies to use a decimal number composed of three digits padded with zeroes to express the sequence number. It is the same syntax supported by the C printf function, but only formats accepting a normal integer are suitable.
    Quote Quote  
  4. yeah i did that %03 thing, it uses all images for 16 sec video. i am looking at the documentation. there is a problem with -r option. for "-r 10", resulting fps is 16 at the end and it uses half of the images ... i want 10 fps for these 399 images to get a ~40 sec video. "-r 10" doesn't do this. thank you however
    Quote Quote  
  5. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Put the -r 10 before the input file, eg
    ffmpeg -f image2 -r 10 -i foo-%03d.jpeg ...
    Quote Quote  
  6. omg! thank you gavino!

    btw, to get same quality (each image is 85KB), which one is the best: adding "-b 850k" or higher to the command (video is 10 fps) or "-sameq"?
    Quote Quote  
  7. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    I think if you use "-vcodec copy", you will get an MJPEG video without any re-encoding of the image data.
    Quote Quote  
  8. ffmpeg -i ma.mp4 -vcodec copy -s 640x360 ma2c.mp4
    ffmpeg -i ma.mp4 -s 640x360 -vcodec copy ma2b.mp4

    i tried commands above, they give exactly the same video. yes i can see them jwplayer but they are not resized. i want to cut heigth and width to half to get a nearly 1/4 file size. my jwplayer window is also 640x360, so big movies are seen as rasterized while not in fullscreen mode... thank you for your reply, expecting more of them
    Quote Quote  
  9. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    When you use -vcodec copy, the -s option is ignored.
    Resizing the image requires recoding.
    Quote Quote  
  10. sorry Gavino, i have another topic, i mix them :/ ... it is:
    https://forum.videohelp.com/threads/331247-ffmpeg-jwplayer-mp4-problem

    anyway do you have a suggestion? as you can see below, the recoded file is not H264, so how can i do that? i think the problem arises from this difference... When i execute "ffmpeg -i ma.mp4 -s 640x360 -sameq ma2.mp4":

    the properties of original file(ma.mp4):
    Video: MPEG4 Video (H264) 1280x720 25.00fps [Video]
    Audio: AAC 44100Hz stereo 1411Kbps [Audio]

    the properties of recoded file(ma2.mp4):
    Video: MPEG4 Video 640x360 25.00fps [Video]
    Audio: AAC 44100Hz stereo 1411Kbps [Audio]
    Quote Quote  
  11. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Use ffmpeg -i ma.mp4 -s 640x360 -vcodec libx264 -sameq ma2.mp4

    If you don't specify a codec (or 'copy', but you can't use copy with -s), I think it defaults to h.263.
    Quote Quote  
  12. i tried your command and alike but i got the following in red color:

    [libx264 @ 01db8d40] broken ffmpeg default settings detected
    [libx264 @ 01db8d40] use an encoding preset (e.g. -vpre medium)
    [libx264 @ 01db8d40] preset usage: -vpre <speed> -vpre <profile>
    [libx264 @ 01db8d40] speed presets are listed in x264 --help
    [libx264 @ 01db8d40] profile is optional; x264 defaults to high
    Quote Quote  
  13. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Did you try (as the message suggests) specifying a preset, eg -vpre medium?
    It might be easier to use a GUI front-end like WinFF or Avanti.
    Quote Quote  
  14. i tried following:

    ffmpeg -i ma.mp4 -s 640x360 -vcodec libx264 -vpre baseline ma2.mp4
    ffmpeg -i ma.mp4 -s 640x360 -vcodec libx264 -vpre hq ma2.mp4

    for the first one it gives this error at the end:
    File for preset 'baseline' not found

    i try -fpre and i give full path to preset file, but it gives same error. btw my original video is:
    http://vimeo.com/14839484
    it is a nice video to check video quality after re-encoding.

    maybe i should convert all files to flv but as far as i can see, the performance of flv is lower than of mp4. what do you recommend? or is there a solution to this problem?
    Quote Quote  
  15. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by mehmedean View Post
    i try -fpre and i give full path to preset file, but it gives same error.
    I would expect that to work. Did you give the entire path name+extension, eg
    -fpre "C:\folder\libx264-hq.ffpreset" ?
    If the folder name includes spaces, you will need quotes round the parameter.

    maybe i should convert all files to flv but as far as i can see, the performance of flv is lower than of mp4.
    Since flv and mp4 are just containers, you would still need to encode to h.264, and it's that step that seems to be giving difficulty at the moment.
    Quote Quote  



Similar Threads