Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-08-2004, 10:45 PM   #1
LQ Newbie
Registered: Apr 2004
Posts: 14

Rep: Reputation: 0 jpg to mpg

Has anyone here used, or anything that uses a video4linux device or webcam or anything.... and endedup with .jpg's?

See, I have motion, and I use this for my house while I'm away. I would like to have .mpg files, and I have compiled/configured/tested ffmpeg (which works with motion) but still can not get .mpg's

I've tried everythnig and have decided to come about it another way,

Is there a way to take a list of lets say 50 .jpg files and make a .mpg movie out of them.?

Any thoughts on either point of view?

Thank you,
Old 12-09-2004, 05:24 PM   #2
LQ Newbie
Registered: Apr 2004
Posts: 14

Original Poster
Rep: Reputation: 0

I have an update for some more specific information that i am looking for.

I can do the following command to turn .jpgs into .mpg

ffmpeg -f image -img jpeg -i img%d.jpg output.mpg

HOWEVER, it will only process with the %d as being 1 digit in order 0-9

I can't take files named like "0192312-q.jpg" and make them process as well. (my images are named as follows, "12.30.00-1" for frame 1 at 12:30.00

Has anyone come across a solution for this with ffmpeg?

I have tried "cat"ing the .jpg files to the standard output, using it that way, but ffmpeg tells me "Incorrect image filename syntax", it must be %d.
Old 12-09-2004, 08:21 PM   #3
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
mjpegtools comes with a utility 'ppmtoy4m' that can convert PPM-format images into a yuv4mpeg stream, which can be piped into mpeg2enc to create an .mpg from them. Check out the Mjpeg HOWTO for more information.

To convert your images to PPM, you can use ImageMagick. For a directory full of jpegs, something like this:

for file in *.jpg
convert $file -depth 8 $file.ppm
If you enter the lines above in your terminal window (one after the other, pressing <enter> at the end of each line) it'll process all the .jpg files in the current directory. You can then use ppmtoy4m on them:

cat *.ppm | ppmtoy4m | mpeg2enc -o output.mpg
You may need to include other options to ppmtoy4m, such as what framerate to use, how many frames to encode, etc.
Old 02-23-2006, 02:40 PM   #4
LQ Newbie
Registered: Feb 2006
Posts: 1

Rep: Reputation: 0
Originally Posted by wapcaplet
mjpegtools comes with a utility 'ppmtoy4m' that can convert PPM-format images into a yuv4mpeg stream .... etc.
I think this method is too complicated for an everyday user. If you are using mplayer (search for it on freshmeat dot net, for example), the movie player for linux, it (usually) comes with a great console-based converter tool called mencoder. Then you can create SVCD movies from any number of jpegs with the next line:

mencoder mf://*.jpg -mf w=640:h=480:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o output.avi

of course you can tune parameters like width, height (640x480 here), frame per second etc. You can rotate or flip images and so on. Give it a try, it has a great manual, too.




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any users here? vharishankar General 6 12-15-2005 06:58 AM
How to work with kornerr Programming 1 10-08-2005 01:04 PM alternative? win32sux General 4 09-21-2005 04:15 PM
JPG+MPG Player nizo Linux - Software 1 05-31-2004 12:12 PM
Can't resolve grayswander Linux - Networking 1 04-05-2004 08:23 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration