FORUMS: list search recent posts

911101 - how to make an h264 video from jpeg files?

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
hamid sherkat
911101 - how to make an h264 video from jpeg files?
on Jan 20, 2013 at 9:27:32 am

hi
i've some jpeg files. i want to put them into sequence in an h264 video. i don't know what the best method for this purpose. i don't want to use an application for this purpose. the environment is Linux (Ubuntu 10.10). i think the best method is to use ffmpeg library. but i don't know what's the easiest and the most straightforward method.
please help me
thx


Return to posts index

stephen dixon
Re: 911101 - how to make an h264 video from jpeg files?
on Jan 21, 2013 at 12:06:54 pm

if you've got an image sequence, Something like this will work
ffmpeg -i myjpeg_0%3d.jpg -vcodec libx264 -preset slow -profile main -crf 20 -r 30 movie.mp4
  • the 0%3d stands for a three digit, zero-padded decimal number. If your jpegs have four digits then use 0%4d 5 digits 0%5d and so on, "myjpeg" is obviously the name of your images.

  • the -vcodec sets the codec to libx24 (h264 encoder)

  • the preset and profile settings will produce good quality movies that play on lots of machines

  • the -crf setting is your quality setting. Confusingly higher numbers are lower quality / smaller file size and lower numbers higher quality / bigger files.

  • -r sets the frame rate

  • movie.mp4 is the name of your output file.


  • Stephen Dixon
    Editor, Animator, Motionographer
    Museum Victoria


    Return to posts index

    Lou Logan
    Re: 911101 - how to make an h264 video from jpeg files?
    on Jan 21, 2013 at 10:16:38 pm

    [stephen dixon] "ffmpeg -i myjpeg_0%3d.jpg -vcodec libx264 -preset slow -profile main -crf 20 -r 30 movie.mp4"

    Default input frame rate is 25, so setting frame rate as an output option will cause ffmpeg to duplicate frames to deal with going from 25 to 30. Sometimes this is desired but usually not. Instead, "-r 30" can be used as an input option (before "-i") and the output will inherit that same frame rate.

    [hamid sherkat] "i've some jpeg files. i want to put them into sequence in an h264 video."

    In addition to what stephen mentioned see the FFmpeg and x264 Encoding Guide for a detailed explanation and examples.

    If your input files are not in sequential order see Using ffmpeg with decimal wildcard for other methods and examples.


    Return to posts index


    stephen dixon
    Re: 911101 - how to make an h264 video from jpeg files?
    on Jan 22, 2013 at 5:03:01 am

    Good catch! I've never realised this, since I work in 25fps all the time.

    Stephen Dixon
    Editor, Animator, Motionographer
    Museum Victoria


    Return to posts index

    << PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
    © 2017 CreativeCOW.net All Rights Reserved
    [TOP]