LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   timelapse to video fail due to power outage (https://www.linuxquestions.org/questions/linux-newbie-8/timelapse-to-video-fail-due-to-power-outage-4175567773/)

rbees 01-24-2016 05:23 AM

timelapse to video fail due to power outage
 
Ladies & Gents,

As always, much thanks and gratitude to those who provide guidance helping us that don't quite get it yet.

That said; I have a some 6000 photos that were captured from a usb camera using motion, but something happened with the power to the laptop and so the output video was never created as in my tests. So now I need to turn these into a video for import to kdenlive as part of a larger construction experiment.

I have ffmpeg installed and I tried from the director where the files are stored
Code:

ffmpeg -y -i *.jpg imagestovideo.mpg
but clearly something is not right with that command as I get this error
Code:

ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Debian 5.3.1-6) 20160114
  configuration: --prefix=/usr --extra-cflags='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security ' --extra-ldflags='-Wl,-z,relro' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-nonfree --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-libvpx --enable-libschroedinger --disable-encoder=libschroedinger --enable-version3 --enable-libopenjpeg --enable-librtmp --enable-avfilter --enable-libfreetype --enable-libvo-aacenc --disable-decoder=amrnb --enable-libvo-amrwbenc --enable-libaacplus --libdir=/usr/lib/x86_64-linux-gnu --disable-vda --enable-libbluray --enable-libcdio --enable-gnutls --enable-frei0r --enable-openssl --enable-libass --enable-libopus --enable-fontconfig --enable-libpulse --disable-mips32r2 --disable-mipsdspr1 --disable-mipsdspr2 --enable-libvidstab --enable-libzvbi --enable-avresample --disable-htmlpages --disable-podpages --enable-libutvideo --enable-libfdk-aac --enable-libx265 --enable-libbs2b --enable-libilbc --enable-libopenh264 --enable-libkvazaar --enable-libiec61883 --enable-vaapi --enable-opencl --enable-libdc1394 --disable-altivec --shlibdir=/usr/lib/x86_64-linux-gnu
  libavutil      54. 31.100 / 54. 31.100
  libavcodec    56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter    5. 40.101 /  5. 40.101
  libavresample  2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample  1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[mjpeg @ 0x21a48e0] Changeing bps to 8
Input #0, image2, from '01-20160122091158-05.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 3480 kb/s
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 352x288 [SAR 1:1 DAR 11:9], 25 tbr, 25 tbn, 25 tbc
[AVFilterGraph @ 0xa269f20] Error initializing threading.
[AVFilterGraph @ 0xa269f20] Error creating filter 'null'
Error opening filters!

The examples at http://photo.stackexchange.com/quest...raphs-in-linux and http://hamelot.co.uk/visualization/u...-into-a-video/ and others show using %d in the command line but when I try that the video files are not found. I assumed that *.jpg would use all the files in the directory ffmpeg was run from, it seams I was wrong.

In the one example they have pic%04d.png which is for padding zeros to the file name , in their case all the files start with pic followed by a number string. In my case each files starts with a number string and zero padding is not needed as far as I can tell. The file names go as
Code:

01-20160122091158-05.jpg
01-20160122091158-15.jpg
01-20160122091158-25.jpg
01-20160122091159-05.jpg
01-20160122091159-15.jpg
.....some 6280 files later
43-20160122122155-23.jpg
43-20160122122156-03.jpg
43-20160122122156-13.jpg

I don't know what causes the name to change from 01 to 02 and so on to 43. The rest of the file name I gather is a time/date stamp. Looking at those assumed time/date stamp names makes me think that I may need to rename the files by actual creation time. Although the photos were taken from the command line with
Code:

ueser@host:~/path/to/folder$ motion
so I assumed that the files were named in sequence correctly. But that is not really an issue at this point because ffmpeg is not generating the video for me.

Any pointers?

Do I need to set a framerate or image size for ffmpeg? Some websites indicate that is not needed.

Thanks

ButterflyMelissa 01-24-2016 05:33 AM

Quote:

ffmpeg -y -i *.jpg imagestovideo.mpg
Hi, this is not how I'd do this...
Install OpenShot. It seems that the names are a sequence that can be logically (read: by a program) followed. I ammaking videos as well, and I use OpenShot for that. As I import pictures that have a sequential name (pic001.jpg, pic002.jpg ect) OpenShot asks me to import the rest as part of a sequence...from there on, the rest should be a snap...
Good luck...
Melissa

rbees 01-24-2016 06:03 AM

Thanks Thor_2.0

Openshot = epic fail on importing 6280 odd photos

103 cpu usage

FYI: I am on Debian Testing

yancek 01-24-2016 07:22 AM

I used the commands below to create a video of .jpg images from zoneminder, video surveillance software. Imagemagick and ffmpeg are needed. If you try it, I would suggest you test it with a smaller number of images in a separate directory first. I don't use these programs often so I don't really know what the various options do and must admit that I was surprised when it actually created a usable video. I believe I found the commands on Stack Exchange, and did have to make a modification to the original ffmpeg command based on a message from the output. Good luck.

mogrify -resize 200x200 *.jpg
# Create the morph images
convert *.jpg -delay 10 -morph 5 05d.jpg
# Stitch them together into a video
ffmpeg -r 50 -i %05d.jpg -q:a 2 output.mp4

rbees 01-24-2016 07:28 AM

Thanks yancek

I did get it with the examples here http://www.cenolan.com/2009/05/simpl...ideo-in-linux/

using mencoder

I think zoneminder uses motion to do its captures. I have tried to setup zoneminder on a different box but the current Debian Testing version fails to install because of a mysql thing, wrong user name or password, something like that anyway. To many other things to do to try to get that figured out at the moment.


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