[FFmpeg-devel] [PATCH 4/6] tools/python: add help script to get sess_config

lance.lmwang at gmail.com lance.lmwang at gmail.com
Wed Apr 28 06:15:02 EEST 2021


On Wed, Apr 28, 2021 at 02:14:17AM +0000, Guo, Yejun wrote:
> 
> 
> > -----Original Message-----
> > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> > lance.lmwang at gmail.com
> > Sent: 2021年4月28日 9:19
> > To: ffmpeg-devel at ffmpeg.org
> > Subject: Re: [FFmpeg-devel] [PATCH 4/6] tools/python: add help script to get
> > sess_config
> > 
> > On Wed, Apr 28, 2021 at 12:44:06AM +0000, Guo, Yejun wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> > > > lance.lmwang at gmail.com
> > > > Sent: 2021年4月27日 17:26
> > > > To: ffmpeg-devel at ffmpeg.org
> > > > Subject: Re: [FFmpeg-devel] [PATCH 4/6] tools/python: add help script to
> > > > get sess_config
> > > >
> > > > On Tue, Apr 27, 2021 at 06:41:11AM +0000, Guo, Yejun wrote:
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf
> > Of
> > > > > > lance.lmwang at gmail.com
> > > > > > Sent: 2021年4月27日 14:29
> > > > > > To: ffmpeg-devel at ffmpeg.org
> > > > > > Subject: Re: [FFmpeg-devel] [PATCH 4/6] tools/python: add help script
> > > > to
> > > > > > get sess_config
> > > > > >
> > > > > > On Tue, Apr 27, 2021 at 04:25:55AM +0000, Guo, Yejun wrote:
> > > > > > >
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Guo, Yejun
> > > > > > > > Sent: 2021年4月27日 12:11
> > > > > > > > To: FFmpeg development discussions and patches
> > > > > > > > <ffmpeg-devel at ffmpeg.org>
> > > > > > > > Subject: RE: [FFmpeg-devel] [PATCH 4/6] tools/python: add help
> > > > script
> > > > > > to
> > > > > > > > get sess_config
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On
> > > > Behalf
> > > > > > Of
> > > > > > > > > lance.lmwang at gmail.com
> > > > > > > > > Sent: 2021年4月26日 18:49
> > > > > > > > > To: ffmpeg-devel at ffmpeg.org
> > > > > > > > > Cc: Limin Wang <lance.lmwang at gmail.com>
> > > > > > > > > Subject: [FFmpeg-devel] [PATCH 4/6] tools/python: add help
> > script
> > > > to
> > > > > > get
> > > > > > > > > sess_config
> > > > > > > > >
> > > > > > > > > From: Limin Wang <lance.lmwang at gmail.com>
> > > > > > > > >
> > > > > > > > > Please note the byte order of the hex data is in normal order.
> > > > > > > > >
> > > > > > > > > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > > > > > > > > ---
> > > > > > > > >  tools/python/tf_sess_config.py | 44
> > > > > > > > > ++++++++++++++++++++++++++++++++++++++++++
> > > > > > > > >  1 file changed, 44 insertions(+)
> > > > > > > > >  create mode 100644 tools/python/tf_sess_config.py
> > > > > > > > >
> > > > > > > > > diff --git a/tools/python/tf_sess_config.py
> > > > > > > > b/tools/python/tf_sess_config.py
> > > > > > > > > new file mode 100644
> > > > > > > > > index 0000000..e4e38bd
> > > > > > > > > --- /dev/null
> > > > > > > > > +++ b/tools/python/tf_sess_config.py
> > > > > > > > > @@ -0,0 +1,44 @@
> > > > > > > >
> > > > > > > > this patch changes the order in current implementation, we'd
> > better
> > > > > > > > merge patch 4 and patch 5 in a single patch, to adjust the order in
> > > > one
> > > > > > > > patch.
> > > > > >
> > > > > > I'm OK with that. I think few people have used the option yet.
> > > > >
> > > > > yes, but we still need to keep the patch modular. There will be
> > > > misleading
> > > > > if people bisect the code with patch 4, without patch 5.
> > > >
> > > > OK, will update and merge the two patch.
> > > >
> > > > >
> > > > > >
> > > > > > >
> > > > > > > and, we may remove '0x' at the beginning of value, since it is no
> > > > longer
> > > > > > > a hex value in math. It is the byte order.
> > > > > >
> > > > > > For hex string, it's preferable to prefix with '0x'.
> > > > >
> > > > > for example, '0x123' is not the value of 3+2*16+1*256, I'm afraid it is
> > > > confusing.
> > > >
> > > > No, your exmple is invalid and will report error for it expects hex stringand
> > > > 2 hex digits
> > > > can represent 1 byte. That's why the current code will check whether
> > > > sess_config_length
> > > > is even.
> > >
> > > my example is to show it is not a valid hex value in math.
> > >
> > > >
> > > >
> > > > >
> > > > > anyway, '0x' as prefix is also an option, we can output a message to
> > > > explain it
> > > > > in python script.
> > >
> > > please output a message in python script for an explanation of the order,
> > thanks.
> > >
> > 
> > I'm not clear for what's message for explanation, what's message you expect?
> 
> like the message in the commit log.

Sure, I'll add a message like below:
a serialized protobuf string for TF_SetConfig, note the byte order is the normal order.
0x10022805320e09000000000000e03f20012a01303801

> 
> > 
> > TF_SetConfig wants user to provide the config as a serialized protobuf string.
> > If you turn on the print by json in the python script, that's print(list(map(hex,
> > s)))
> > ['0x10', '0x2', '0x28', '0x5', '0x32', '0xe', '0x9', '0x9a', '0x99', '0x99', '0x99',
> > '0x99', '0x99', '0xb9', '0x3f', '0x20', '0x1', '0x2a', '0x1', '0x30', '0x38', '0x1']
> > 
> > So we use the hex string format like below so that we can use them in config
> > easily.
> > 0x10022805320e099a9999999999b93f20012a01303801
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

-- 
Thanks,
Limin Wang


More information about the ffmpeg-devel mailing list