LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 08-19-2020, 03:12 PM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,972

Rep: Reputation: 271Reputation: 271Reputation: 271
Making a movie from stills in CentOS


I have a series of webcam photos I want to string together to make a short film. I'm a Slackware user, have used mencoder and ffmpeg. The system is CentOS though. I ran
Code:
 yum whatprovides mencoder
and
Code:
 yum whatprovides ffmpeg
, which turn up nothing. (Surprising me.) Have I made a mistake in my search, or should I use something else?
 
Old 08-19-2020, 03:19 PM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555
Quote:
Originally Posted by RandomTroll View Post
Have I made a mistake in my search
You need to add another repository - various explanations at the other end of https://duckduckgo.com/?q=centos+ffmpeg and https://duckduckgo.com/?q=centos+mencoder

 
1 members found this post helpful.
Old 08-19-2020, 03:36 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Quote:
I have a series of webcam photos I want to string together to make a short film
After you get ffmpeg installed.

A few examples:

Make vid from directory of images, 5 second duration on each, 30fps.
Code:
ffmpeg -framerate 1/5 -pattern_type glob -i '*.png' -c:v libx264 -crf 18 -preset slow -r 30 -pix_fmt yuv420p out.mp4
Make vid from images of different size, pad and center, into a 1280x720 video.
Code:
ffmpeg -framerate 1/5 -pattern_type glob -i '*.png' -vf scale=-1:-1,pad=1280:720:ow-iw/2:oh-ih/2 -c:v libx264 -crf 18 -preset slow -r 30 -pix_fmt yuv420p out.mp4
Make vid from 1 image and 30 second audio file
Code:
ffmpeg -i AudioFile.m4a -loop 1 -t 00:00:30 -i Image.png -c:a copy -c:v libx264 -crf 18 -preset slow -r 30 -pix_fmt yuv420p Out.mp4
Make vid from 1 image and 40 min audio, overlay run time on video
Code:
ffmpeg -i input.mp3 -loop 1 -t 00:40:00 -i input.png -c:a copy -c:v libx264 -crf 18 -preset slow -r 30 -pix_fmt yuv420p -vf "drawtext=text='%{pts\:hms}': x=(w-tw)/2: y=h-(2*lh): fontcolor=white: fontsize=50: box=1: boxcolor=0x00000099" Out.mp4
etc.
 
1 members found this post helpful.
Old 08-20-2020, 01:38 AM   #4
henderson
Member
 
Registered: Mar 2018
Distribution: Linux Mint
Posts: 43

Rep: Reputation: 34
Hello RandomTroll, I recommend to use Ubuntu for this, it works like a charm!
 
Old 08-22-2020, 11:17 AM   #5
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,972

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by boughtonp View Post
You need to add another repository
Thanks. I have no choice of distribution on this system - I just work on it. Unfortunately it's old (in interest of security) and I couldn't reconcile modern packages with it. I ended up downloading the source and building.
 
Old 08-23-2020, 05:16 AM   #6
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,972

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Hey, @teckk, I want to make a movie from the last 24 hours' of images for a webcam. I tried:
Code:
 ffmpeg -pattern-type glob -framerate 24 -i 'ls -tr camera*.jpg | tail -360' camera.avi
but it didn't interpret 'ls -tr camera*.jpg | tail -360'. I ended up with:

Code:
FileList=`ls -tr camera*.jpg | tail -360 | tr '\n' '#' | sed 's/#/ -i /g'
ffmpeg -pattern-type glob -framerate 24 -i $FileList end.jpg camera.avi
but that seemed really inelegant.
 
Old 08-23-2020, 01:55 PM   #7
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Code:
#Example make a dir and change to it.
mkdir pic
cd ~/pic

#Make 50 .jpg file names into the dir
for i in {1..50}; do
    touch camera"$i".jpg
done
Code:
#This is not sorted
ls -tr camera*.jpg | tail -10 | tr '\n' '#' | sed 's/#/ -i /g'
camera39.jpg -i camera44.jpg -i camera43.jpg -i camera42.jpg -i camera47.jpg -i camera46.jpg -i camera45.jpg -i camera50.jpg -i camera49.jpg -i camera48.jpg -i
How about:
Code:
#Make array of files in dir, sorted by number
for file in *; do
    sorted=$(echo "$file")
    files[$sorted]="$file"
done

#Check it
echo "${files[@]}"

#Get the last 10
last10=$(echo "${files[@]:40}")

#Check it
echo "$last10"
 
Old 08-24-2020, 12:58 PM   #8
henderson
Member
 
Registered: Mar 2018
Distribution: Linux Mint
Posts: 43

Rep: Reputation: 34
Quote:
Originally Posted by RandomTroll View Post
Thanks. I have no choice of distribution on this system - I just work on it. Unfortunately it's old (in interest of security) and I couldn't reconcile modern packages with it. I ended up downloading the source and building.
But you can find good movie software on an old system?
 
Old 08-25-2020, 02:59 AM   #9
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,972

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Trying to use an environment variable for the input argument ran into the maximum size of environment variables, in this case about enough for 300 file names. I ended up making links in a temporary directory:
Code:
for file in `ls -tr camera*.jpg | tail -360`
do
ln -sf ../$file .temp/camera-$count.jpeg
let count=count+1
done
then using -i .temp/camera-%03d.jpeg for the input argument.
 
Old 08-26-2020, 01:56 AM   #10
henderson
Member
 
Registered: Mar 2018
Distribution: Linux Mint
Posts: 43

Rep: Reputation: 34
Quote:
Originally Posted by RandomTroll View Post
Trying to use an environment variable for the input argument ran into the maximum size of environment variables, in this case about enough for 300 file names. I ended up making links in a temporary directory:
Code:
for file in `ls -tr camera*.jpg | tail -360`
do
ln -sf ../$file .temp/camera-$count.jpeg
let count=count+1
done
then using -i .temp/camera-%03d.jpeg for the input argument.
Which software did you install?
 
Old 08-26-2020, 08:58 AM   #11
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
Quote:
Which software did you install?
Quote:
then using -i .temp/camera-%03d.jpeg for the input argument.
ffmpeg.

Make 20 images of file.mp4, 1 per seond
Code:
ffmpeg -t 00:00:20 -i file.mp4 -s 400x300 -vf fps=1 camera-%03d.jpeg
Make video of those 20 images, each image displays for 2 seconds
Code:
ffmpeg -framerate 1/2 -pattern_type glob -i '*.jpeg' -c:v libx264 -crf 18 -preset slow -r 30 -pix_fmt yuv420p out.mp4
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with playing a movie with default movie players of Centos 6.4 ziok Linux - Newbie 4 10-12-2015 01:44 PM
Higher resolution webcam stills ilw Linux - Software 1 08-24-2012 05:43 AM
Down Network interface stills answers ping! strutter79 Linux - Networking 1 08-10-2007 08:01 PM
Creating a dvd movie out of different movie files.. memo007 Linux - Software 4 04-10-2007 10:21 PM
Stills to movies? davecs Linux - Software 6 12-08-2004 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 02:44 AM.

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