4

When I run the following line on my video it only outputs P frames and B frames and no I frame,

ffprobe -select_streams v -show_frames -show_entries frame=pict_type -of csv 00000.MTS

How is it possible for a video not to have I frames.
Here is the link to the video.
According to this tutorial's definition, P frames are just built upon previous frames, If there is no other frame to build upon how can we use P frames?
Output of ffprobe -i 00000.MTS is:

...
Input #0, mpegts, from '00000.MTS':
  Duration: 00:17:13.24, start: 1.040000, bitrate: 16451 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
    Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
FazeL
  • 916
  • 2
  • 13
  • 30

2 Answers2

4

I see plenty of I-frames in the shared sample video.

Run

ffprobe videotoshare.mts -show_entries frame=key_frame,pict_type,pkt_pts_time -select_streams v -of compact -v 0 | grep ame=1

frame|key_frame=1|pkt_pts_time=1.520000|pict_type=I
frame|key_frame=1|pkt_pts_time=2.040000|pict_type=I
frame|key_frame=1|pkt_pts_time=2.560000|pict_type=I
frame|key_frame=1|pkt_pts_time=3.080000|pict_type=I
frame|key_frame=1|pkt_pts_time=3.600000|pict_type=I
frame|key_frame=1|pkt_pts_time=4.120000|pict_type=I
frame|key_frame=1|pkt_pts_time=4.640000|pict_type=I
frame|key_frame=1|pkt_pts_time=5.160000|pict_type=I

Full video shows similar readout

ffprobe videotoshare-full.mts -show_entries frame=key_frame,pict_type,pkt_pts_time -select_streams v -of compact -v 0 | grep ame=1

frame|key_frame=1|pkt_pts_time=1.120000|pict_type=I
frame|key_frame=1|pkt_pts_time=1.640000|pict_type=I
frame|key_frame=1|pkt_pts_time=2.160000|pict_type=I
frame|key_frame=1|pkt_pts_time=2.680000|pict_type=I
frame|key_frame=1|pkt_pts_time=3.200000|pict_type=I
frame|key_frame=1|pkt_pts_time=3.720000|pict_type=I
Gyan
  • 85,394
  • 9
  • 169
  • 201
  • After cutting the video I frames inserted themselves in. – FazeL Feb 08 '18 at 15:31
  • with `ffmpeg -i input.mts -t 60 -c copy output.mp4` – FazeL Feb 10 '18 at 09:24
  • That method can't create any new keyframes. – Gyan Feb 10 '18 at 10:50
  • I try to upload the whole video for you to check, today. – FazeL Feb 10 '18 at 12:03
  • any idea if something like `avconv ... "-flags" "+global_header" "-segment_time" "60" "-f" "segment"` should be able to split such file? I got a file here that it said it was splitting but in the end I got only a single part with full size, and had many log lines like this "[mp4 @ 0x16cc8c1] pts has no valueN/A time=01:34:23.44 bitrate=N/A". If it can be split, I create a new question :) – Aquarius Power Mar 29 '19 at 02:30
  • https://stackoverflow.com/questions/55544615/how-to-split-a-video-that-has-weird-keyframes-pkt-pts-time-n-a – Aquarius Power Apr 05 '19 at 23:47
2

As mentioned in Wikipedia :

P-frames can contain either intra macroblocks or predicted macroblocks

So your video can contain I-frame macroblocks in P-frames.

  • 1
    Intra macroblocks are those predicted based on other MBs in the frame. However, a frame consisting of all intra MBs is an I-frame, of which the author saw none. – Gyan Feb 08 '18 at 14:05