0

i am using the following: ffprobe -i bunny.mp4 -v quiet -select_streams v -print_format json -show_entries frame=pkt_pts_time,pict_type|grep -B 1 pict_type=I

so i can save time of index frames in json file. also the command works just fine without the: "print formqt json", it doesnt seem to work after i add it. i have tried "print format json " commands like: ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" and it works just fine. what might be the problem?

1 Answers1

0

grep is looking for the wrong string.

It should be

ffprobe -i bunny.mp4 -v quiet -select_streams v -print_format json -show_entries frame=pkt_pts_time,pict_type | grep -B 1 "\"pict_type\": \"I\""

Gyan
  • 85,394
  • 9
  • 169
  • 201
  • it still doesnt generate json ,the output is in the following format: "pkt_pts_time": "0.000000", "pict_type": "I" -- – user1083237 Sep 01 '18 at 11:23
  • It won't be valid json after you grep it. You can come close by using `-B 2 -A 1` in grep – Gyan Sep 01 '18 at 13:26