VideoHelp Forum

Try DVDFab and copy Ultra HD Blu-rays and DVDs! Or rip iTunes movies and music! Download free trial !
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Forgive me in advance for probably not using the right protocol when presenting my problem. So I am trying to make a batch script for FFMPEG conversion to TIFF, which is for a series of video clips which I have named in a numerical series. I am converting from mp4's to TIFF folders, and I have the proper command when entering it from the cmd console.
    The command I am using is for instance:

    ffmpeg -i 321.mp4 -compression_algo raw -pix_fmt rgb24 321-%3d.tiff

    This works great when I just copy and paste into cmd. In order to do the series, I have just manipulated with excel to change the numerical file name, and reformatted in Notepad to just cut and paste for each clip conversion. BUT, when I simply put this in a batch script format, and try to run it, it doesn't convert, and gives me the following:

    Image
    [Attachment 55117 - Click to enlarge]


    This is just the first part of a script that I want to write to do all the operations I would like to do, involving copying, moving, and renaming files as necessary for my project, which I have worked out in separate batch scripts already, but I would like to combine into a large script where I can perform all of these actions sequentially on a 20 file block of clips.
    Thanks in advance!!!
    Quote Quote  
  2. Syntax changes slightly in a .bat file vs command line: each "percent" sign (%) must be doubled (%%).
    https://forum.videohelp.com/threads/398507-Top10-Commands-for-Lossless-Video-manipulat...e)#post2592949
    Quote Quote  
  3. The output has to use %03d for the syntax, for 3 digit padding

    Code:
    321-%03d.tiff
    would result in

    321-001.tiff
    321-002.tiff
    321-003.tiff
    .
    .
    .

    Use -start_number 0 if you want to start at zero
    Quote Quote  
  4. Thanks! That totally worked like a charm. Is there a resource that might entail these pitfalls when going from command line to batch script? I looked around for this for awhile before asking anyone for help, but it was a difficult search with a lot of trial and error...
    Quote Quote  
  5. @poisondeathray - I actually tried that before posting, but it did not solve my problem. It ended up being the %% vs %. Thanks for the start at 0 advice, it is good to know, but unnecessary in this instance. I am importing the tiffs into Davinci Resolve, and it doesn't care about the numbering, as long as they are in sequential order...
    Quote Quote  
  6. Originally Posted by Jolly Green View Post
    Thanks! That totally worked like a charm. Is there a resource that might entail these pitfalls when going from command line to batch script? I looked around for this for awhile before asking anyone for help, but it was a difficult search with a lot of trial and error...
    if what you are trying to do is non trivial, have a look at some existing scripts. A lot is non obvious with windows command line.

    I would use "321.mp4" for instance. Is it required ? No, unless you have a space in the file path...
    Quote Quote  



Similar Threads