VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. How can i get screenshot like this using ffmpeg command line? i found to extract only one frame but i could not find any command line to create screenshot like this using ffmpeg.

    https://forum.videohelp.com/images/imgfiles/xGcbp4F.jpg


    currently i using mtn file. i got an output like this https://forum.videohelp.com/images/imgfiles/Z9fxzWV.jpg

    it's like mtn movie thumbnailer could not read the middle of the video file time line. it happened for couple of video file. i tried few other command line for mtn movie thumbnailer but result is same. so i want to test with FFMPEG.
    Quote Quote  
  2. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Try ffmpeg tile filter.
    Quote Quote  
  3. Something like:
    Code:
    ffmpeg -i %1 -vf "select='eq(pict_type,I)',scale=192:-2,tile=2x4" -vsync 0 "%1_preview_I_frame_%%06d.png"
    Last edited by pandy; 26th Jul 2021 at 15:49.
    Quote Quote  
  4. thank you, it's working fine.

    it seems ffmpeg or mtn having trouble to read files for that particular files. anyway for ffmpeg i used `--ss 00:05:00` and tried the `tile=2x4` mode. ffmpeg made the screenshot but it made all screenshot close to 5 min duration. default settings take random frame screenshot. is there anyway i can set from which duration ffmpeg will start to take screenshot and add the time interval as well? like start to take screenshot from --ss 00:05:00 and give 2min interval to take next images?
    Quote Quote  
  5. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Use the seconds formula:

    Code:
    ffmpeg -i input -filter_complex "select='not(mod(n,120))',scale=120:-1,tile=layout=3x2:padding=4" -vframes 1 -q:v 2 output.jpg
    Select one frame every 120 seconds
    Scale each frame to a smaller size (alternatively you can scale after tile)
    Tile each frame into one image. Default grid size is 3x2, Padding between images is 4 pixels
    You may have to adjust that with layout depending on how many images you want to display.

    Image
    [Attachment 60080 - Click to enlarge]
    Last edited by Budman1; 27th Jul 2021 at 23:01.
    Quote Quote  
  6. i am not sure but is't `scale=xx` using for the the image wide?

    may be use this?
    -vf fps=1/100

    Code:
    https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video
    Quote Quote  
  7. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    may be use this?
    -vf fps=1/100
    Not sure... I prefer not to affect fps size or time for adjustments. It can cause too many computations for me. I prefer to work with actual pixels for width,height,resize, etc.

    The scale=120:-1 says scale the width to 120 pixels and the height proportional to the oruiginal aspect (-1)

    select='not(mod(n,120)) means select 1 frame every 120 seconds (2 minutes)

    padding=4 means separate each image by 4 pixels. So:

    3x120 =360 plus 2 gaps of 4=8 total is 368 pxels, as shown by the screen ruler
    Quote Quote  
  8. thank you so much, i mixed up with scale and "select='not(mod(n,120))". my bad.

    i added -ss 00:10:00 and then i added select='not(mod(n,200)). i got the desire output screenshot.
    Quote Quote  
  9. You can also use dedicated thumbnail filter for this task or combine it with previously used select .
    Quote Quote  



Similar Threads

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