Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Create Video from JPEGs

  1. #11
    Join Date
    Feb 2007
    Beans
    2,339
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Create Video from JPEGs

    The commands are supposed to be entered directly into terminal. But if you want to put into a script, add this as the first line:
    Code:
    #!/bin/bash
    So it should look like this:
    Code:
    #!/bin/bash
    
    mkdir out
    for a in $( ls in ); do
    convert "in/$a" -resize 800x600 -background black -gravity center -extent 800x600 "out/$a"
    done
    Last edited by chewearn; January 19th, 2010 at 08:16 PM.

  2. #12
    Join Date
    Aug 2009
    Beans
    3,391
    Distro
    Ubuntu Development Release

    Re: Create Video from JPEGs

    That script worked fantastic and I did just enter it in the terminal.
    I am learning. But the AVI still came out only 3 seconds long with FPS=1
    This is the command I entered inside the out directory:

    mencoder "mf://*.jpg" -mf fps=1 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4

    It is 3 seconds long and displays the first 3 pictures in the folder.

    Thanks for all of your help!
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 Mate | Mint 13 | Mint 17 | Windows 7 | All 64 bit

  3. #13
    Join Date
    Aug 2009
    Beans
    3,391
    Distro
    Ubuntu Development Release

    Re: Create Video from JPEGs

    Something is wrong with pic 2 and 3 and that must be why it only displays 3 pictures
    no matter what the FPS is set to. I look at the properties > image and instead of displaying
    800 x 600 like the rest it just says loading...

    Trying to figure that out...
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 Mate | Mint 13 | Mint 17 | Windows 7 | All 64 bit

  4. #14
    Join Date
    Aug 2009
    Beans
    3,391
    Distro
    Ubuntu Development Release

    Re: Create Video from JPEGs

    I deleted the contents of out and ran the script again, but the exact same results occurred.
    Picture 2 and 3 indicate loading... on the properties instead of 800 x 600.
    All of the rest of them show the correct resolution 800 x 600.

    I cannot figure this out! It is messed up after the script converts the files, but I don't know why.

    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 Mate | Mint 13 | Mint 17 | Windows 7 | All 64 bit

  5. #15
    Join Date
    Apr 2006
    Location
    Melbourne, Aus
    Beans
    15
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Create Video from JPEGs

    Hi,

    I can't help you with the mencoder problem, but note that making slides using mencoder is limited as it doesn't provide transitions from slide to slide, etc. You might want to consider some alternatives (both of which I successfully use):

    From the command line, I use dvd-slideshow. The author gives a complete guide to creating a standalone DVD here.

    Alternatively, imagination is a GUI based program. It is still in development, but works for my simple needs.

  6. #16
    Join Date
    Feb 2007
    Beans
    2,339
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Create Video from JPEGs

    Quote Originally Posted by Cavsfan View Post
    I deleted the contents of out and ran the script again, but the exact same results occurred.
    Picture 2 and 3 indicate loading... on the properties instead of 800 x 600.
    All of the rest of them show the correct resolution 800 x 600.

    I cannot figure this out! It is messed up after the script converts the files, but I don't know why.

    Since it's two pictures only, perhaps you could manually convert these two, e.g. using GIMP.

  7. #17
    Join Date
    Aug 2009
    Beans
    3,391
    Distro
    Ubuntu Development Release

    Re: Create Video from JPEGs

    Quote Originally Posted by chewearn View Post
    Since it's two pictures only, perhaps you could manually convert these two, e.g. using GIMP.
    I have been trying different things and I got past the first few pictures, but for some reason ImageMagick
    is not really seeing all 153 pictures.
    When I enter this identify command in the out directory, it is only seeing 38 of the 153 still.

    All 153 of the images display 800 x 600 in properties.
    (Inside of out directory I enter "identify *.jpg" and this is the output (notice how it skips around e.g. going from C021 to C034):

    Code:
    C001.jpg JPEG 800x600 800x600+0+0 8-bit DirectClass 269kb 
    C002.jpg[1] JPEG 800x600 800x600+0+0 8-bit DirectClass 84.3kb 
    C003.jpg[2] JPEG 800x600 800x600+0+0 8-bit DirectClass 77.8kb 
    C004.jpg[3] JPEG 800x600 800x600+0+0 8-bit DirectClass 129kb 
    C005.jpg[4] JPEG 800x600 800x600+0+0 8-bit DirectClass 136kb 
    C006.jpg[5] JPEG 800x600 800x600+0+0 8-bit DirectClass 131kb 
    C007.jpg[6] JPEG 800x600 800x600+0+0 8-bit DirectClass 131kb 
    C008.jpg[7] JPEG 800x600 800x600+0+0 8-bit DirectClass 134kb 
    C009.jpg[8] JPEG 800x600 800x600+0+0 8-bit DirectClass 338kb 
    C010.jpg[9] JPEG 800x600 800x600+0+0 8-bit DirectClass 143kb 
    C011.jpg[10] JPEG 800x600 800x600+0+0 8-bit DirectClass 135kb 
    C012.jpg[11] JPEG 800x600 800x600+0+0 8-bit DirectClass 95.2kb 
    C013.jpg[12] JPEG 800x600 800x600+0+0 8-bit DirectClass 121kb 
    C014.jpg[13] JPEG 800x600 800x600+0+0 8-bit DirectClass 112kb 
    C015.jpg[14] JPEG 800x600 800x600+0+0 8-bit DirectClass 104kb 
    C016.jpg[15] JPEG 800x600 800x600+0+0 8-bit DirectClass 135kb 
    C017.jpg[16] JPEG 800x600 800x600+0+0 8-bit DirectClass 123kb 
    C018.jpg[17] JPEG 800x600 800x600+0+0 8-bit DirectClass 115kb 
    C019.jpg[18] JPEG 800x600 800x600+0+0 8-bit DirectClass 120kb 
    C020.jpg[19] JPEG 800x600 800x600+0+0 8-bit DirectClass 119kb 
    C021.jpg[20] JPEG 800x600 800x600+0+0 8-bit DirectClass 114kb 
    C034.jpg[21] JPEG 800x600 800x600+0+0 8-bit DirectClass 61.1kb 
    C035.jpg[22] JPEG 800x600 800x600+0+0 8-bit DirectClass 98.8kb 
    C036.jpg[23] JPEG 800x600 800x600+0+0 8-bit DirectClass 107kb 
    C038.jpg[24] JPEG 800x600 800x600+0+0 8-bit DirectClass 67.1kb 
    C041.jpg[25] JPEG 800x600 800x600+0+0 8-bit DirectClass 59.1kb 
    C042.jpg[26] JPEG 800x600 800x600+0+0 8-bit DirectClass 40.2kb 
    C043.jpg[27] JPEG 800x600 800x600+0+0 8-bit DirectClass 67.5kb 
    C044.jpg[28] JPEG 800x600 800x600+0+0 8-bit DirectClass 56.4kb 
    C045.jpg[29] JPEG 800x600 800x600+0+0 8-bit DirectClass 68.4kb 
    C051.jpg[30] JPEG 800x600 800x600+0+0 8-bit DirectClass 54.8kb 
    C052.jpg[31] JPEG 800x600 800x600+0+0 8-bit DirectClass 50.2kb 
    C053.jpg[32] JPEG 800x600 800x600+0+0 8-bit DirectClass 74.5kb 
    C058.jpg[33] JPEG 800x600 800x600+0+0 8-bit DirectClass 51.3kb 
    C059.jpg[34] JPEG 800x600 800x600+0+0 8-bit DirectClass 50.7kb 
    C060.jpg[35] JPEG 800x600 800x600+0+0 8-bit DirectClass 47.1kb 
    C069.jpg[36] JPEG 800x600 800x600+0+0 8-bit DirectClass 70.9kb 
    C125.jpg[37] JPEG 800x600 800x600+0+0 8-bit DirectClass 296kb
    Even "ls" and "ls *.jpg" entered in the out directory yield different results.
    ("ls" lists all files, but only the 38 displayed above are kind of a pink color and the rest are black, while "ls *.jpg" lists only the 38 that are displayed above and all are pink)

    So, the problem would be in the convert command and not in the mencoder command.
    Would you have any idea why?

    Thanks!
    PS Thanks to everyone else, but I am on a mission with mencoder right now and it is doing exactly what I want, except for this issue.
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 Mate | Mint 13 | Mint 17 | Windows 7 | All 64 bit

  8. #18
    Join Date
    Aug 2009
    Beans
    3,391
    Distro
    Ubuntu Development Release

    Re: Create Video from JPEGs

    I think I discovered something

    Only the images that end in .jpg are the ones that are working.
    The ones that end in .JPG are not!

    If I can figure out a way to get them all to small letters, I think it would work.
    And I have found that the properties displaying 800 x 600 do not matter.

    Only the jpg vx JPG appears to matter.
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 Mate | Mint 13 | Mint 17 | Windows 7 | All 64 bit

  9. #19
    Join Date
    Feb 2007
    Beans
    2,339
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Create Video from JPEGs

    Quote Originally Posted by Cavsfan View Post
    Even "ls" and "ls *.jpg" entered in the out directory yield different results.
    ("ls" lists all files, but only the 38 displayed above are kind of a pink color and the rest are black, while "ls *.jpg" lists only the 38 that are displayed above and all are pink)
    The different colour meant that Ubuntu has somehow identified the files as different type. I think pink are images; black are probably text files. I'm not sure why you ended up with text files.

    You could add "-verbose" switch to the "convert" command to see some output during conversion. It might gave a clue.

    Only the images that end in .jpg are the ones that are working.
    The ones that end in .JPG are not!
    Since ext3 file system is case sensitive, "ls *.jpg" and "ls *.JPG" give different results.

  10. #20
    Join Date
    Feb 2007
    Beans
    2,339
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Create Video from JPEGs

    Quote Originally Posted by Cavsfan View Post
    If I can figure out a way to get them all to small letters, I think it would work.
    I forgot this part; to rename "JPG" to "jpg":
    Code:
    rename -v 's/JPG/jpg/' *.JPG

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •