Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
883ce264
Commit
883ce264
authored
8 years ago
by
Vittorio Giovara
Browse files
Options
Downloads
Patches
Plain Diff
vf_showinfo: Display spherical properties
parent
3f128fc4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavfilter/vf_showinfo.c
+41
-0
41 additions, 0 deletions
libavfilter/vf_showinfo.c
with
41 additions
and
0 deletions
libavfilter/vf_showinfo.c
+
41
−
0
View file @
883ce264
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include
"libavutil/imgutils.h"
#include
"libavutil/imgutils.h"
#include
"libavutil/internal.h"
#include
"libavutil/internal.h"
#include
"libavutil/pixdesc.h"
#include
"libavutil/pixdesc.h"
#include
"libavutil/spherical.h"
#include
"libavutil/stereo3d.h"
#include
"libavutil/stereo3d.h"
#include
"avfilter.h"
#include
"avfilter.h"
...
@@ -39,6 +40,43 @@ typedef struct ShowInfoContext {
...
@@ -39,6 +40,43 @@ typedef struct ShowInfoContext {
unsigned
int
frame
;
unsigned
int
frame
;
}
ShowInfoContext
;
}
ShowInfoContext
;
static
void
dump_spherical
(
AVFilterContext
*
ctx
,
AVFrame
*
frame
,
AVFrameSideData
*
sd
)
{
AVSphericalMapping
*
spherical
=
(
AVSphericalMapping
*
)
sd
->
data
;
double
yaw
,
pitch
,
roll
;
av_log
(
ctx
,
AV_LOG_INFO
,
"spherical information: "
);
if
(
sd
->
size
<
sizeof
(
*
spherical
))
{
av_log
(
ctx
,
AV_LOG_INFO
,
"invalid data"
);
return
;
}
if
(
spherical
->
projection
==
AV_SPHERICAL_EQUIRECTANGULAR
)
av_log
(
ctx
,
AV_LOG_INFO
,
"equirectangular "
);
else
if
(
spherical
->
projection
==
AV_SPHERICAL_CUBEMAP
)
av_log
(
ctx
,
AV_LOG_INFO
,
"cubemap "
);
else
if
(
spherical
->
projection
==
AV_SPHERICAL_EQUIRECTANGULAR_TILE
)
av_log
(
ctx
,
AV_LOG_INFO
,
"tiled equirectangular "
);
else
{
av_log
(
ctx
,
AV_LOG_WARNING
,
"unknown"
);
return
;
}
yaw
=
((
double
)
spherical
->
yaw
)
/
(
1
<<
16
);
pitch
=
((
double
)
spherical
->
pitch
)
/
(
1
<<
16
);
roll
=
((
double
)
spherical
->
roll
)
/
(
1
<<
16
);
av_log
(
ctx
,
AV_LOG_INFO
,
"(%f/%f/%f) "
,
yaw
,
pitch
,
roll
);
if
(
spherical
->
projection
==
AV_SPHERICAL_EQUIRECTANGULAR_TILE
)
{
size_t
l
,
t
,
r
,
b
;
av_spherical_tile_bounds
(
spherical
,
frame
->
width
,
frame
->
height
,
&
l
,
&
t
,
&
r
,
&
b
);
av_log
(
ctx
,
AV_LOG_INFO
,
"[%zu, %zu, %zu, %zu] "
,
l
,
t
,
r
,
b
);
}
else
if
(
spherical
->
projection
==
AV_SPHERICAL_CUBEMAP
)
{
av_log
(
ctx
,
AV_LOG_INFO
,
"[pad %"
PRIu32
"] "
,
spherical
->
padding
);
}
}
static
void
dump_stereo3d
(
AVFilterContext
*
ctx
,
AVFrameSideData
*
sd
)
static
void
dump_stereo3d
(
AVFilterContext
*
ctx
,
AVFrameSideData
*
sd
)
{
{
AVStereo3D
*
stereo
;
AVStereo3D
*
stereo
;
...
@@ -105,6 +143,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
...
@@ -105,6 +143,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
case
AV_FRAME_DATA_A53_CC
:
case
AV_FRAME_DATA_A53_CC
:
av_log
(
ctx
,
AV_LOG_INFO
,
"A/53 closed captions (%d bytes)"
,
sd
->
size
);
av_log
(
ctx
,
AV_LOG_INFO
,
"A/53 closed captions (%d bytes)"
,
sd
->
size
);
break
;
break
;
case
AV_FRAME_DATA_SPHERICAL
:
dump_spherical
(
ctx
,
frame
,
sd
);
break
;
case
AV_FRAME_DATA_STEREO3D
:
case
AV_FRAME_DATA_STEREO3D
:
dump_stereo3d
(
ctx
,
sd
);
dump_stereo3d
(
ctx
,
sd
);
break
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment