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

2020-07-11 Thread Mark Filipak

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    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)/2700 seconds
 ((146)(300)+85)/2700 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.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

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

2020-07-11 Thread Hans Carlson

On Sat, 11 Jul 2020, Michael Koch wrote:

$ ffprobe -f lavfi -i movie=input.mp4,find_rect=options -show_entries 
frame=pkt_pts_time:frame_tags=lavfi.rect.w,lavfi.rect.h,lavfi.rect.x,lavfi.rect.y 
-of csv


The above command works fine, but is it possible to print the number of 
the frame instead of the timestamp?


I might be wrong, but I believe you need to infer the frame number based 
on where it appears in the output.  Given your example, with "frame" 
section and "csv" output, the 1st line is the 1st frame, the 2nd line is 
the 2nd frame, etc.


If you're processing this via a script of some kind, you might consider 
the JSON output format.  With JSON, the output is an ARRAY of OBJECTS 
where the frame number would be based on the ARRAY index.  Converting the 
JSON structure to various programming languages is usually quite simple. 
In perl for instance, it's one line of code and you now have a perl LIST 
of HASHES.


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.

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Documentation of chromanr filter

2020-07-11 Thread Mark Filipak

On 07/11/2020 03:27 AM, Michael Koch wrote:
-snip-

Foreach neighbour pixel
{
   A = absolute difference of U components of current pixel and neighbour pixel
   B = absolute difference of V components of current pixel and neighbour pixel
   if (A+B < threshold) then
     use this neighbour pixel for averaging
}

-snip-

May I suggest this:

1, For each 'input' sample, and
2, For each of 3 (corner) or 5 (edge) or 8 (interior) 'neighbor' samples,
2.1, If the sum of 'input' U and 'neighbor' U is less than 'threshold', and
2.2, If the sum of 'input' V and 'neighbor' V is less than 'threshold', then
2.3, Add 'neighbor' to 'candidates'.
3, Average U and V of 'input' and all 'candidates', if any, and assign the new U and V to the new 
'output' sample.


Instead of describing what an algorithm does, simply translate the code to human readable form, line 
by line. Taking that approach makes the documentation easier to understand, it assures 
code-documentation coverage, and it actually makes the documentation easier & faster to write.


___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Documentation of chromanr filter

2020-07-11 Thread Carl Zwanzig

On 7/11/2020 1:39 AM, Paul B Mahol wrote:

Can you elaborate what you tried and what failed?


Why does it matter???

Someone has gone to the effort to identify a problem and suggest a solution. 
I'd expect that whomever has been maintaining that code would welcome this 
and incorporate that doc change almost immediately (looks like almost the 
simplest thing to change).


As Michael points out, being a "user" list there are few people on it who 
are developers; you're expecting one of them to install (and learn) git, 
pull the code, _find_ that piece of the doc, created a git patch, and send 
it up to where it might be rejected for a trivial and opaque reason. That is 
not rational. What _is_ rational is for the code maintainer to say "Oh, 
cool, that looks better that what I have, I'll use it." And if that specific 
developer doesn't read this list, I'm willing to bet that someone who does 
can send them the relevant info.


(I've been on both the developer and QA sides of the process. People can 
make it easy or they can make it difficult; I prefer the former.)


Later,

z!
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

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

2020-07-11 Thread Michael Koch

Hi Moritz,




Hello,

I want to track an object and need the x,y coordinates of this object
for each frame.
Is it possible to write the output of the find_rect filter to a file?

I don't have any good command line for find_rect handy, but it should
work with something like this (untested, of course):

$ ffprobe -f lavfi -i movie=input.mp4,find_rect=options -show_entries 
frame=pkt_pts_time:frame_tags=lavfi.rect.w,lavfi.rect.h,lavfi.rect.x,lavfi.rect.y
 -of csv


The above command works fine, but is it possible to print the number of 
the frame instead of the timestamp?
I did search the documentation for a list of variables, but didn't find 
any. Also "pkt_pts_time" seems to be undocumented.


Michael

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] hevc_vaapi mkv output fails with generic error

2020-07-11 Thread Xiang, Haihao

According to the your debug output below, the encoded stream is not muxable to
some containers, maybe this the root cause of your issue.

[hevc_vaapi @ 0x5239bc0] Driver does not support some wanted packed headers
(wanted 0xd, found 0).
[hevc_vaapi @ 0x5239bc0] Driver does not support packed sequence headers, but a
global header is requested.
[hevc_vaapi @ 0x5239bc0] No global header will be written: this may result in a
stream which is not usable for some purposes (e.g. not muxable to some
containers).

Thanks
Haihao

> Hello everyone,
> 
> I am currently unable to transcode H264 MKV to HEVC MKV on an AMD Ryzen
> 3400G running openSuSE Leap 15.2. 
>  
> Using following command
>  
> ffmpeg -loglevel debug -vaapi_device /dev/dri/renderD128 -hwaccel vaapi
> -hwaccel_output_format vaapi -i sample.mkv -c:v hevc_vaapi -vf
> 'hwdownload,format=nv12,hwupload' -rc_mode 3 -b:v 3M -profile:v 1 -tier
> 1 -level 153 -c:a copy output.mkv
>  
> I am getting follwing error message
>  
> [AVHWFramesContext @ 0x52a3cc0] Created surface 0x22.
> [AVHWFramesContext @ 0x52a3cc0] Direct mapping disabled: deriving image
> does not work: 1 (operation failed).
> [matroska @ 0x5235ec0] get_metadata_duration returned: 0
> Could not write header for output file #0 (incorrect codec parameters
> ?): Invalid data found when processing input
> Error initializing output stream 0:0 --
> [AVIOContext @ 0x5209740] Statistics: 0 seeks, 1 writeouts
> [AVIOContext @ 0x5284400] Statistics: 197393 bytes read, 2 seeks
>  
> FFmpeg static build by myself.
>  
> Is there anyone who can help me understanding what is going on here and
> how to get this working?
> I am breaking my head for 3 days now trying to solve this issue.
>  
> Full debug output here: https://pastebin.com/khp5g9F5
> <
> https://deref-web.de/mail/client/gxpESspRx9g/dereferrer/?redirectUrl=https%3A%2F%2Fpastebin.com%2Fkhp5g9F5
> >
>  
> Best regards,
> Andreas
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] unsubscribe

2020-07-11 Thread Reindl Harald
WTF

Am 11.07.20 um 14:09 schrieb Colin Bitterfield:
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] unsubscribe

2020-07-11 Thread Colin Bitterfield
unsubscribe

--
Colin A. Bitterfield
Direct: (571) 533-4700
https://www.linkedin.com/in/colin-bitterfield/
Mailto: co...@bitterfield.com
On Jul 6, 2020, 5:48 AM -0400, FFmpeg user questions , 
wrote:
>
> unsubscribe
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Documentation of chromanr filter

2020-07-11 Thread Michael Koch

Am 11.07.2020 um 10:39 schrieb Paul B Mahol:

On 7/11/20, Michael Koch  wrote:

Am 11.07.2020 um 10:12 schrieb Paul B Mahol:

Please send patch, otherwise it have little sense to discuss this.

This is the ffmpeg _user_ list, and 90% of all users (including me) are
not professional programmers and don't know how to use git.
I have seen the instructions at https://www.ffmpeg.org/git-howto.html
but this looks quite complicated to me. I did already try git some time
ago without success.

Can you elaborate what you tried and what failed?


I don't remember. It's too long ago.

Michael

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Documentation of chromanr filter

2020-07-11 Thread Paul B Mahol
On 7/11/20, Michael Koch  wrote:
> Am 11.07.2020 um 10:12 schrieb Paul B Mahol:
>> Please send patch, otherwise it have little sense to discuss this.
>
> This is the ffmpeg _user_ list, and 90% of all users (including me) are
> not professional programmers and don't know how to use git.
> I have seen the instructions at https://www.ffmpeg.org/git-howto.html
> but this looks quite complicated to me. I did already try git some time
> ago without success.

Can you elaborate what you tried and what failed?

>
> Michael
>
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Documentation of chromanr filter

2020-07-11 Thread Michael Koch

Am 11.07.2020 um 10:12 schrieb Paul B Mahol:

Please send patch, otherwise it have little sense to discuss this.


This is the ffmpeg _user_ list, and 90% of all users (including me) are 
not professional programmers and don't know how to use git.
I have seen the instructions at https://www.ffmpeg.org/git-howto.html 
but this looks quite complicated to me. I did already try git some time 
ago without success.


Michael

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Documentation of chromanr filter

2020-07-11 Thread Paul B Mahol
Please send patch, otherwise it have little sense to discuss this.

On 7/11/20, Michael Koch  wrote:
> Hello,
>
> The documentation of the new chromanr filter, especially this sentence
> for the "thres" option is hard to understand:
>
> "Sum of absolute difference of U and V pixel components or current pixel
> and neighbour pixels lower than this threshold will be used in averaging."
>
> First of all I think "or" is a typo and should be "of". But even with
> this change the sentence is still hard to understand.
> The sum of absolute differences of what? Sum of absolute differences of
> the U and V pixel components? That makes no sense.
>
> This is how I think it might work:
> Foreach neighbour pixel
> {
>A = absolute difference of U components of current pixel and
> neighbour pixel
>B = absolute difference of V components of current pixel and
> neighbour pixel
>if (A+B < threshold) then
>  use this neighbour pixel for averaging
> }
>
> If the above is correct, I suggest to change the sentence as follows:
>
> "The algorithm calculates the absolute difference of the U components of
> the current pixel and a neighbour pixel. The same is also calculated for
> the V components. A neighbour pixel is used for averaging, if the sum of
> both absolute differences is lower than the threshold."
>
> Also the meaning of  "stepw" and "steph" options is unclear:
> -- Do these options refer to the pixels? If stepw=2 and steph=2 then
> only a quarter of the pixels is analyzed, and the same U and V
> components are used for 4 pixels?
> -- Or do they refer to the selection of the neighbour pixels? If stepw=2
> and steph=2 then only a quarter of the neighbour pixels is analyzed?
>
> Michael
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Documentation of chromanr filter

2020-07-11 Thread Michael Koch

Hello,

The documentation of the new chromanr filter, especially this sentence 
for the "thres" option is hard to understand:


"Sum of absolute difference of U and V pixel components or current pixel 
and neighbour pixels lower than this threshold will be used in averaging."


First of all I think "or" is a typo and should be "of". But even with 
this change the sentence is still hard to understand.
The sum of absolute differences of what? Sum of absolute differences of 
the U and V pixel components? That makes no sense.


This is how I think it might work:
Foreach neighbour pixel
{
  A = absolute difference of U components of current pixel and 
neighbour pixel
  B = absolute difference of V components of current pixel and 
neighbour pixel

  if (A+B < threshold) then
    use this neighbour pixel for averaging
}

If the above is correct, I suggest to change the sentence as follows:

"The algorithm calculates the absolute difference of the U components of 
the current pixel and a neighbour pixel. The same is also calculated for 
the V components. A neighbour pixel is used for averaging, if the sum of 
both absolute differences is lower than the threshold."


Also the meaning of  "stepw" and "steph" options is unclear:
-- Do these options refer to the pixels? If stepw=2 and steph=2 then 
only a quarter of the pixels is analyzed, and the same U and V 
components are used for 4 pixels?
-- Or do they refer to the selection of the neighbour pixels? If stepw=2 
and steph=2 then only a quarter of the neighbour pixels is analyzed?


Michael
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".