VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Member
    Join Date
    Apr 2021
    Location
    Seoul,Korea
    Search Comp PM
    Hello

    I have confused one thing for Video Frame extraction.

    I have sample.mp4 video , 15FPS

    https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4

    I tried extracting Keyframe with FFMPEG.

    ffmpeg -skip_frame nokey -i sample.mp4 -vsync 0 -frame_pts true out%d.png

    I get 29 Pictures and I believe I have got 29 I frames. (If I have wrong, Please correct me)
    Image
    [Attachment 58370 - Click to enlarge]


    Then I tried extracting specific timeline(10 sec) frame with picture

    ffmpeg -i sample.mp4 -ss 00:00:10 -frames:v 1 test1.png

    This output picture, I can not find same one among my Keyframes I get.
    Image
    [Attachment 58371 - Click to enlarge]


    Question: test1.png, What is frame type? Does it one of P or B frame not I ?
    Quote Quote  
  2. VirtualDub shows the frame at 10.00 seconds a P frame (and it matches the test1.png image, and your I frame images all match what VirtualDub shows as I frames). ffpropbe shows the same:

    Code:
            {
                "media_type": "video",
                "stream_index": 0,
                "key_frame": 0,
                "pkt_pts": 153600,
                "pkt_pts_time": "10.000000",
                "pkt_dts": 153600,
                "pkt_dts_time": "10.000000",
                "best_effort_timestamp": 153600,
                "best_effort_timestamp_time": "10.000000",
                "pkt_duration": 1024,
                "pkt_duration_time": "0.066667",
                "pkt_pos": "813473",
                "pkt_size": "736",
                "width": 320,
                "height": 240,
                "pix_fmt": "yuv420p",
                "sample_aspect_ratio": "1:1",
                "pict_type": "P",
                "coded_picture_number": 150,
                "display_picture_number": 0,
                "interlaced_frame": 0,
                "top_field_first": 0,
                "repeat_pict": 0,
                "chroma_location": "left"
            },
    Why were you expecting the frame at 10.0 seconds to be an I frame?
    Last edited by jagabo; 12th Apr 2021 at 08:33.
    Quote Quote  
  3. Member
    Join Date
    Apr 2021
    Location
    Seoul,Korea
    Search Comp PM
    Thank you.

    How to get such information on virtualdub? I am not familiar with virtualdub yet. Please let me know.
    {
    ...
    "pict_type": "P"
    }


    Actually, the video player I am using(Chrome Web Player), it shows "thumbnail preview" when it has moved mouse point on progress bar. It looks extract thumbnail image every 10 sec from the video source. So, I expect it will be "I" frame.But when I extract "I" frame thru ffmpeg, there is not matched (I frame picture vs thumbnail preview) at all.

    I think the web video player will display thumbnail with P frame. (Please correct me if I have worng)

    Thank you
    Last edited by symoon2021; 12th Apr 2021 at 09:15.
    Quote Quote  
  4. VirtualDub can show you the frame type below the timeline slider. I don't remember if it defaults to show it. You may have to go into the preferences and enable it. It shows K for I frames, P for P frames, and B for B frames.

    Image
    [Attachment 58377 - Click to enlarge]


    If your player is showing thumbnails at 10 second intervals it is not restricted to I frames. The video doesn't have keyframes at 10 second intervals.
    Quote Quote  
  5. Member
    Join Date
    Apr 2021
    Location
    Seoul,Korea
    Search Comp PM
    Thank you. It will be very helpful for me. Appreciate!
    Quote Quote  
  6. By the way, you can navigate directly to keyframes in VirtualDub using Shift+RightArrow (next keyframe), or Shift+LeftArrow (previous keyframe).
    Quote Quote  



Similar Threads

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