Results 1 to 6 of 6

Thread: FFmpeg encoder CLI command to encode an entire directory (or GUI)

  1. #1
    Join Date
    May 2009
    Location
    Canada
    Beans
    868
    Distro
    Ubuntu Development Release

    FFmpeg encoder CLI command to encode an entire directory (or GUI)

    Hey,

    I installed the latest FFmpeg and x264 via this thread. I'm just wondering if there was a single command possible to encode an entire directory of videos (>100 video files) all to x264 codec with MKV container (with support for multi-threaded CPUs of course). Otherwise, is there a particular GUI front-end for the ffmpeg encoder I set up that you would particularly recommend that will allow me to do that?

    Thanks!
    Intel Core i7 970 6/12 (Cores/Threads) 3.2GHz 12MB Cache
    6GB DDR3
    1866MHz RAM | ATI Radeon HD 5770 1GB GDDR5
    60GB SSD
    (/) | 1TB 64MB Cache HDD (/home)
    Ubuntu Oneiric
    Ocelot 11.10 x64

  2. #2
    Join Date
    Dec 2006
    Beans
    6,930

    Re: FFmpeg encoder CLI command to encode an entire directory (or GUI)

    It can be done with a for loop. Are these files all the same type, as in all .mp4, .flv or .avi?
    You think that's air you're breathing now?

  3. #3
    Join Date
    May 2009
    Location
    Canada
    Beans
    868
    Distro
    Ubuntu Development Release

    Re: FFmpeg encoder CLI command to encode an entire directory (or GUI)

    Quote Originally Posted by andrew.46 View Post
    It can be done with a for loop. Are these files all the same type, as in all .mp4, .flv or .avi?
    Yeah, they are all in some stupid real media format, which is why I'm considering re-encoding them. Though most of them are .rmvb, a small amount are .rm, no big deal as I can just run two commands, one for each?

    EDIT: Oh, and I would like the output to have the same file name as the input for each file. Not sure if that's a problem, just thought I'd mention it.
    Last edited by akand074; May 22nd, 2011 at 06:21 PM.
    Intel Core i7 970 6/12 (Cores/Threads) 3.2GHz 12MB Cache
    6GB DDR3
    1866MHz RAM | ATI Radeon HD 5770 1GB GDDR5
    60GB SSD
    (/) | 1TB 64MB Cache HDD (/home)
    Ubuntu Oneiric
    Ocelot 11.10 x64

  4. #4
    Join Date
    Dec 2006
    Beans
    6,930

    Re: FFmpeg encoder CLI command to encode an entire directory (or GUI)

    rmvb files used to pose a bit of a problem for FFmpeg and some may still be problematic. Perhaps try a test run of something like the following, from the directory that your files are in:

    Code:
    for f in *.rmvb
    do 
    ffmpeg -i "$f" -acodec libfaac -aq 100 -vcodec libx264 -preset slow -crf 22 -threads 0 "${f%.rmvb}.mkv"
    done
    The FFmpeg syntax is drawn from Fakeoutdoorsman's guide. Hopefully FFmpeg will not choke on your rmvbs but some can be difficult still...
    You think that's air you're breathing now?

  5. #5
    Join Date
    May 2009
    Location
    Canada
    Beans
    868
    Distro
    Ubuntu Development Release

    Re: FFmpeg encoder CLI command to encode an entire directory (or GUI)

    Success. That worked! I just copied 5 files into a new directory to test it out and it worked fine, it didn't choke on the file types. I'll likely tweak with the ffmpeg settings from the default but the loop worked perfectly.
    Intel Core i7 970 6/12 (Cores/Threads) 3.2GHz 12MB Cache
    6GB DDR3
    1866MHz RAM | ATI Radeon HD 5770 1GB GDDR5
    60GB SSD
    (/) | 1TB 64MB Cache HDD (/home)
    Ubuntu Oneiric
    Ocelot 11.10 x64

  6. #6
    Join Date
    Dec 2006
    Beans
    6,930

    Re: FFmpeg encoder CLI command to encode an entire directory (or GUI)

    Excellent news! Tweak to your heart's content that is in part what FFmpeg is all about .
    You think that's air you're breathing now?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •