VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  1. Member
    Join Date
    Mar 2007
    Location
    Brazil
    Search Comp PM
    Im on windows 7. I have multiple videos in a folder and need to extract 1 image from the exact same frame of each of those videos (that is 20 seconds into each video), i know the command below extract the image from a single video:

    Code:
    ffmpeg -ss 20 -i video.mp4 -t 1 -s 590x340 -f image2 imagefile.jpg
    and even tho it throws me this error:

    Code:
    Could not get frame filename number 2 from pattern '
    imagefile.jpg' (either set updatefirst or use a pattern like %03d within the filen
    ame pattern)
    the image is extracted just fine.

    Any bash script that could automate this process for every video on this folder in one go? The videos names are not in a sequence, totally different from each other.

    Also the extracted image files would need to have different names so they dont replace each other when extracting. Would be good the images had the same filenames of the input videos.

    Please let me know, thank you!
    Quote Quote  
  2. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    This is for Windows but you can apply exactly the same principles for any operating system. 'rem' is the Windows comment identifier - nothing on that line is executed.
    Code:
    rem Processes all videos, one at a time
    rem Bases the output filename on the input filename to ensure uniqueness
    rem %%i is replaced with the names of the files, one at a time. Substitute *.mp4 as needed.
    
    for %%i in (*.mp4) do ffmpeg -ss 20 -i %%i -t 1 -s 590x340 -f image2 %%i.jpg
    Cheers,
    Francois
    Quote Quote  
  3. Member
    Join Date
    Mar 2007
    Location
    Brazil
    Search Comp PM
    That did it, thank you!
    Quote Quote  



Similar Threads

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