Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get video frames information with ffmpeg

How can I retrieve information from video about byte number from which every frame starts, with using ffmpeg or something else?

like image 540
Dmitriy Karpov Avatar asked Dec 17 '14 16:12

Dmitriy Karpov


People also ask

What is frame in ffmpeg?

ffmpeg can be used to change the frame rate of an existing video, such that the output frame rate is lower or higher than the input frame rate. The output duration of the video will stay the same.

How do I set video duration in ffmpeg?

Use the -t option to specify a time limit: `-t duration' Restrict the transcoded/captured video sequence to the duration specified in seconds. hh:mm:ss[.


1 Answers

You can try ffprobe:

$ ffprobe -show_frames input.mkv
...
[FRAME]
media_type=video
key_frame=0
pkt_pts=3240
pkt_pts_time=3.240000
pkt_dts=N/A
pkt_dts_time=N/A
best_effort_timestamp=3240
best_effort_timestamp_time=3.240000
pkt_duration=40
pkt_duration_time=0.040000
pkt_pos=18009
pkt_size=480
width=320
height=240
pix_fmt=yuv444p
sample_aspect_ratio=1:1
pict_type=P
coded_picture_number=76
display_picture_number=0
interlaced_frame=0
top_field_first=0
repeat_pict=0
[/FRAME]
  • pkt_pos may be what you're looking for.
  • If you only want info from the video stream add -select_streams v:0.
  • See FFprobe Documentation and FFmpeg Wiki: FFprobe Tips for more examples.
like image 155
llogan Avatar answered Oct 23 '22 05:10

llogan