I have a cam set up to document a construction site. It takes one jpg every 20 seconds and puts them in a directory. Once it reaches 999 pics, it starts a new directory.
So I have:
and so on. After a few days, there are dozens of directories and it gets real old running ffmpeg on each one by hand and then concatenatingCode:100MEDIA/ DSCF0001.JPG DSCF0002.JPG DSCF0003.JPG 101MEDIA/ DSCF0001.JPG DSCF0002.JPG DSCF0003.JPG
What I would like is some command line way to tell ffmpeg to Just Do It.
I found this:But that makes a separate mp4 for every jpg. Not the idea at all. I want it to go through all the directories, accumulate all the jpgs, and turn them into one mp4.Code:find . -type f -name "*.JPG" -exec bash -c 'ffmpeg -i "$0" -c:a copy test1.mp4' "{}" \;
It's probably a fairly small tweak to that command but nothing I try gets me anywhere because I don't know what I'm doing
Thanks for any help you can give me! (And if this needs to be moved to the Linux subforum, please go ahead!)
+ Reply to Thread
Results 1 to 3 of 3
-
Last edited by quixote7; 18th Dec 2018 at 16:25. Reason: found solution
-
The command I'm currently using within each separate dir is:
Code:ffmpeg -framerate 20 -i DSCF%04d.JPG -c:v libx264 -crf 20 -pix_fmt yuvj422p ../[filename].mp4 -hide_banner
-
I found a solution here, or at least a kludge. Just in case it's useful to someone else:
-Use the "find" command to generate a list of all files to feed to ffmpeg
-Use "cat" to read those out line by line
and
-pipe that to ffmpeg
The commands are run in the directory that contains the subdirs of jpg files
Code:find . -type f -name DSCF????.JPG > inputlist.txt cat $(cat inputlist.txt) | ffmpeg -r 30 -f image2pipe -vcodec mjpeg -i - test9.mp4
You can provide some additional parameters. E.g.;
Code:cat $(cat inputlist.txt) | ffmpeg -r 30 -f image2pipe -vcodec mjpeg -i - -c:v libx264 -crf 30 -pix_fmt yuvj422p -s 640x480 -c:a copy ~/test12.mp4
Similar Threads
-
Make slide shows including jpgs and camera video and burn it to a DVD.
By Darl Lyn in forum Newbie / General discussionsReplies: 7Last Post: 8th Nov 2018, 10:03 -
Combine JPGs and animated GIFs to video? (Any format ok. MP4, MKV, etc.)
By vidyanoob in forum Video ConversionReplies: 6Last Post: 31st May 2018, 03:09 -
ffmpeg to convert 4k/hdr10 to (i) h.264/10-bit/.mp4 (ii) h.265/10-bit/.mp4
By hydra3333 in forum Video ConversionReplies: 2Last Post: 10th Feb 2018, 19:49 -
MPG2Cut2 to FFMPEG MP4 vs FFMPEG MPG2 to MP4 AviDemux
By RedPenguin in forum Video ConversionReplies: 4Last Post: 29th Apr 2015, 12:16 -
Ts to Mp4 FFmpeg Issue
By PolarWindzTranscode in forum Video ConversionReplies: 2Last Post: 2nd Feb 2014, 05:30