-1

My intention would be to get at the same time, picture1.jpg, picture2.jpg, picture3.jpg to video format such as picture1.mp4, picture2.mp4, picture3.mp4.

I am currently using Mencoder and Linux bash code mencoder mf: //*.jpg -mf w = 1366: h = 768: fps = 6/60: type = jpg -ovc copy -oac copy -o images.mp4. But this command makes all the images into one video file (images.mp4).

Can I do it with mencoder or ffmpeg? My linux bash coding skills are basic.


I found a solution that works for me as I want. Thank you to all who helped me.

#! /bin/bash
for input in *.jpg
do
mencoder -ovc copy -mf w=1366:h=768:fps=1/11:type=jpg -ofps 30000/1001 mf://"$input" -o $(echo $input | sed -e 's/.jpg$/.mp4/')
done
David van rijn
  • 2,108
  • 9
  • 21
Ertzi
  • 3
  • 3
  • If I understand, you want to create multiple one frame videos? – Maxito Jul 13 '15 at 15:29
  • I have an automatic m3u playlist with .jpg images. Images (input) should be able to convert with the same name but .mp4 (output) file. This is part of Digital Signage software, where images and video are in the same playlist. DS software does not know how to properly display images, which is why I need to convert images to video file. – Ertzi Jul 13 '15 at 16:01

1 Answers1

0

I am not entirely sure on what kind of videos you want, but the basic pattern for doing a conversion for a bunch of files is

for input in *.jpg
do
  output=$(echo $input | sed -e 's/.jpg$/.mp4/')
  # whatever command including $input and $output
done
Daniel Landau
  • 2,264
  • 2
  • 15
  • 19
  • I tried to Daniel Landau's advice and my results were pretty close to what I'm looking for. I got the files modified to the same names. But all the pictures, however, were all inside the video. Video did not contain a single image just all listed images. This script below, gives the result "= 1.image.mp4 = 2.image.mp4". . ****** #!/bin/bash for input in *.jpg do mencoder mf://*.jpg -mf w=1366:h=768:fps=6/60:type=jpg -ovc copy -oac copy -o =$(echo $input | sed -e 's/.jpg$/.mp4/') # whatever command including $input and $output done ****** – Ertzi Jul 13 '15 at 16:34
  • I think you want this in the middle... `mencoder mf: "$input" ....` in any case you need to tell `mencoder` that it should take its input from `"$input"` – Mark Setchell Jul 13 '15 at 17:46
  • Thank you Mark Setchell your advice. I got it to work the way I want. Now the problem is mencoder. I'll try to get one image to 10 seconds long video. Now I get only the first 10 seconds of black screen and the the next 10 seconds with image, total 20 sec. The strange thing yet to be resolved. *** #! /bin/bash for input in *.jpg do mencoder -ovc copy -mf w=1366:h=768:fps=1/10:type=jpg mf://"$input" -o $(echo | sed -e 's/.jpg$/.mp4/') done *** – Ertzi Jul 14 '15 at 14:25