[FFmpeg-user] write output of find_rect to a file?

Mark Filipak markfilipak.windows+ffmpeg at gmail.com
Sun Jul 12 07:20:39 EEST 2020


On 07/11/2020 05:52 PM, Hans Carlson wrote:
> On Sat, 11 Jul 2020, Michael Koch wrote:
-snip-
>> I did search the documentation for a list of variables, but didn't find any. Also "pkt_pts_time" 
>> seems to be undocumented.
> 
> I've never found any documentation for this either.  The closest is the output of "ffprobe 
> -sections", but that only lists the possible "sections", not the "entries" within each section.  It 
> would be nice if there was a "ffprobe -entries [section]" option that listed all entries (optionally 
> for a specific section), along with a brief description of each entry. I have no idea if it would be 
> possible for that to be auto-generated based on information already available in the existing code.

I'm very interested in pkt_pts_time, too (and also pkt_duration_time). I assume both are computed 
based on SCR (or PTS or DTS) but the formula I have (below) doesn't produce sensible frame 
durations. Note that my only source is for MPEG.

For example: First 10 bytes of a pack header:
[0]   pack_id 00 00 01 BA
               44 00 05 24 94 D1
[4]   marker  01-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
[4.2] SCR     --00 0-00 0000 0000 0000 0-01 0010 0100 1001 0--- ---- ----
[4.5] marker  ---- -1-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
[6.5] marker  ---- ---- ---- ---- ---- -1-- ---- ---- ---- ---- ---- ----
[8.5] marker  ---- ---- ---- ---- ---- ---- ---- ---- ---- -1-- ---- ----
[8.6] SCR_ext ---- ---- ---- ---- ---- ---- ---- ---- ---- --00 1011 000-
[9.7] marker  ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---1

formula: ((SCR)(300)+SCR_ext)/27000000 seconds
          ((146)(300)+85)/27000000 seconds

The above is from an MPEG program stream, and match the numbers in the nav pack, but the frame 
durations are a little more than 3x too short, producing FPSs that are a little more than 3x too 
high. Compounding this is that nav packs and PES headers (which contain the numbers) only exist (in 
MPEG) for GOPs -- though ffprobe reports them for every frame (but how ffprobe does it is undocumented).

Mark.



More information about the ffmpeg-user mailing list