0

I am extracting a frame per every second using this below command,

ffmpeg -i input.ts -vf "select='if(eq(n\,0),1,floor(t)-floor(prev_selected_t))'" -vsync 0 output-%04d.png

I want to get the each extracted frame's offset byte into a file.

Also I have got a command to extract the offset byte for keyframes only using below command.

ffprobe -skip_frame nokey -select_streams v:0 -count_frames -show_entries frame=pkt_pos,best_effort_timestamp_time -of csv INPUT.ts > output.txt

The above command is only extracting the offset bytes for only keyframes, I want to get the offset byte posistions for every extracted frame's offset byte.

Are there any options to achieve this with ffmpeg or ffprobe?

geo-freak
  • 327
  • 3
  • 20
  • `Are there any options to achieve this with ffmpeg or ffprobe?` Not reliably, no. some formats, like TS, do not have contagious fames. meaning an offset may give you a few bytes for that frame, but then be interleaved with other data for another stream. – szatmary May 28 '20 at 17:16
  • @szatmary so based on your comment, we still can get the offset byte for every extracted frame?(But that might not be exact stream's data), right? – geo-freak May 31 '20 at 19:05
  • @szatmary also I added -g1 option in the above ffprobe command. Then I got frames offset bytes(I think they are every frame's offset). Without the -g 1 option I got onl;y keyframe's offset bytes. But after adding this -g 1 option, I got the offset poistions in between the keyframes also. So does that mean, every frame's offset byte? or wrong? – geo-freak May 31 '20 at 19:09

0 Answers0