3

I am checking a video file using ffprobe to findout if a video file has any b_frames or not, i can see ffprobe output shows “has_b_frames=0" , “has_b_frames=1" and “has_b_frames=2" when i check for different video files.

index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Main
codec_type=video
codec_time_base=1001/60000
codec_tag_string=avc1
codec_tag=0x31637661
width=1080
height=1920
coded_width=1088
coded_height=1920
has_b_frames=1

“has_b_frames=0" means there are no B frames present in video file ?

can someone tell me what these values indicates,

Sunil Kumar
  • 367
  • 2
  • 5
  • 19

1 Answers1

3

has_b_franes in general indicates whether there's video delay i.e. is the frame presented in same order as decoding. The actual attribute being referenced depends on the specific bitstream format. For H264, it's the maximum expected delay, in frames, between when a frame is decoded and its presentation. For other codecs, it may reveal if there's some delay, but not how much.

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • What does "when a frame is decoded and its presentation" mean? What is that time of "when" a frame is decoded? And "its presentation" is the time PTS that is associated with a frame? – AlexZheda Feb 23 '20 at 21:51
  • 1
    As the answer says, for H264, it's the gap in frames between decode and presentation. Let's say, storage and decoding order is I P B2 B1 B3 then P is 2nd frame decoded. Presentation order is I B1 B2 B3 P, so it's 5th frame presented. – Gyan Feb 24 '20 at 04:38
  • Excuse me my amateur question - so the presentation order is, say, the order, in which a video player is playing ("presenting") the frames? Whereas the storage/decoding order is the sequence of bits of the streams data itself? – AlexZheda Feb 24 '20 at 14:25
  • Could you please help me with this question? I think it is an issue related to the presentation and the underlying time base. There is a discrepancy in `time_base` and `codec_time_base`. https://stackoverflow.com/questions/60368162/conversion-failed-2-frames-left-in-the-queue-on-closing-ffmpeg – AlexZheda Feb 24 '20 at 20:47
  • Does anybody know how to enable B frames? – user1315621 May 27 '21 at 14:31