Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Mencoder on jessie

Sat Mar 12, 2016 9:41 pm

Hello, i try to use mncoder for make timelapse on jessie,

Code: Select all

sudo apt-get install mplayer mencoder
I get:

Code: Select all

E: Package 'mencoder' has no installation candidate
How to install it? Or may have an analogue?

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: Mencoder on jessie

Sat Mar 12, 2016 10:11 pm

Ivan219 wrote:Hello, i try to use mncoder for make timelapse on jessie,

Code: Select all

sudo apt-get install mplayer mencoder
I get:

Code: Select all

E: Package 'mencoder' has no installation candidate
How to install it? Or may have an analogue?
Jessie has changed packages: viewtopic.php?f=66&t=123442
Take what I advise as advice not the utopian holy grail, and it is gratis !!

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: Mencoder on jessie

Sun Mar 13, 2016 6:10 pm

Sorry, i don't understand. What must I do?

fruitoftheloom
Posts: 27226
Joined: Tue Mar 25, 2014 12:40 pm

Re: Mencoder on jessie

Sun Mar 13, 2016 6:34 pm

Ivan219 wrote:Sorry, i don't understand. What must I do?
https://wiki.debian.org/ffmpeg

Code: Select all

sudo apt-get update
sudo apt-get install mpv
sudo apt-get install libav-tools
Take what I advise as advice not the utopian holy grail, and it is gratis !!

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: Mencoder on jessie

Sun Mar 13, 2016 7:00 pm

I have done this commands. And how to run:

Code: Select all

sudo mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o timelapse.avi -mf type=jpeg:fps=24 mf://@stills.txt

Sorry, I'm still new

kyle2k
Posts: 84
Joined: Tue Feb 19, 2013 2:47 pm

Re: Mencoder on jessie

Sun Mar 13, 2016 7:50 pm

You now create your timelapse with avconv command.
the code below will take all .jpg called test_0001 (and upwards) files in the current directory and create a video called test_timelapse.mp4 at 10 fps

Code: Select all

avconv -r 10 -i test_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 test_timelapse.mp4
See this link for a tutorial and explanation of the code used.
https://www.raspberrypi.org/learning/cr ... worksheet/

Regards Kyle

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: Mencoder on jessie

Sun Mar 13, 2016 8:42 pm

Thank you for reply. My files has number with time, for example: foto_1425121203.jpg, foto_1433371203.jpg
How to write mask with "foto_"+number_time?

kyle2k
Posts: 84
Joined: Tue Feb 19, 2013 2:47 pm

Re: Mencoder on jessie

Sun Mar 13, 2016 10:10 pm

Hi again,

If you want to make a timelapse from pictures you have already taken then you could try the code below.

Code: Select all

avconv -r 10 -i foto_%10d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 test_timelapse.mp4
The (foto_%10d.jpg) part is assuming your files are incrementally named foto_(and 10 digits).jpg
for future timelapse try to name your files pic_0001.jpg etc........

See the tutorial link I posted in the above post :)

Regards Kyle

Ivan219
Posts: 118
Joined: Sun Jul 05, 2015 10:01 pm

Re: Mencoder on jessie

Mon Mar 14, 2016 5:01 pm

I try your command and get:

Code: Select all

foto_%10d.jpg: No such file or directory
, may be i have this error, because the first name: foto_1421361203.jpg, not foto_0000000001.jpg?

raspberry949
Posts: 1
Joined: Thu May 19, 2016 3:44 pm

Re: Mencoder on jessie

Thu May 19, 2016 3:54 pm

I had a similar problem, and would like to post a fix. You have to rename the files so they are named 000000.jpg, 000001.jpg, etc:

Code: Select all

x=0;  
for i in *jpg;  
do counter=$(printf %06d $x);  
ln -s "$i" /tmp/img"$counter".jpg;  
x=$(($x+1));
you may then create your timelapse:

Code: Select all

avconv -i /tmp/img%6d.jpg -r 24 -vcodec libx264 -crf 20 -g 15 test_timelapse.mp4
The following script takes pictures with numerical file names. The advantage over raspistill is it takes one picture and then quits, so it won't use memory continuously, and you can put it into crontab and have it work automatically after a reboot.

Code: Select all

#!/bin/bash

DIR=/home/pi/timelapse/pics

if [ -f $DIR/000000.jpg ]; then
    NUM=`ls -t $DIR/*.jpg | head -1 | sed -r 's/.*\/([0-9]*)\..*/\1/g' | sed 's/^0*//'`
    NUM=$(($NUM + 1))
    printf -v NUM "%06d" $NUM
else
    NUM="000000"
fi

echo $NUM
fswebcam -S 30 -r 1920x1080 $DIR/$NUM.jpg

Return to “Beginners”