VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. 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:
    Code:
       100MEDIA/
           DSCF0001.JPG
           DSCF0002.JPG
           DSCF0003.JPG
       101MEDIA/
           DSCF0001.JPG
           DSCF0002.JPG
           DSCF0003.JPG
    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 concatenating

    What I would like is some command line way to tell ffmpeg to Just Do It.

    I found this:
    Code:
    find . -type f -name "*.JPG" -exec bash -c 'ffmpeg -i "$0" -c:a copy test1.mp4' "{}" \;
    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.

    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!)
    Last edited by quixote7; 18th Dec 2018 at 17:25. Reason: found solution
    Quote Quote  
  2. 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
    Quote Quote  
  3. 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
    Substitute your filenames for the ones in italics. The "image2pipe" and "vodec mjpeg" seem to be necessary. Doesn't work without them. Maybe you can find alternatives if you know what you're doing.

    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
    It complained about deprecated pixel formats and the lack of an EndOfImage, but did process as expected and made a much smaller file size. (crf 30 = low quality, s 640x480 = low res)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!