Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
92c07acc
Commit
92c07acc
authored
Nov 17, 2014
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Read (display) aspect ratio from mxf files.
Fixes ticket #4107.
parent
0b3c2305
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
avformat.h
libavformat/avformat.h
+7
-0
mxfdec.c
libavformat/mxfdec.c
+2
-0
utils.c
libavformat/utils.c
+5
-0
No files found.
libavformat/avformat.h
View file @
92c07acc
...
...
@@ -1103,6 +1103,13 @@ typedef struct AVStream {
* Keys are separated from values by '='.
*/
char
*
recommended_encoder_configuration
;
/**
* display aspect ratio (0 if unknown)
* - encoding: unused
* - decoding: Set by libavformat to calculate sample_aspect_ratio internally
*/
AVRational
display_aspect_ratio
;
}
AVStream
;
AVRational
av_stream_get_r_frame_rate
(
const
AVStream
*
s
);
...
...
libavformat/mxfdec.c
View file @
92c07acc
...
...
@@ -1781,6 +1781,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
if
(
source_track
->
sequence
->
origin
)
{
av_dict_set_int
(
&
st
->
metadata
,
"source_track_origin"
,
source_track
->
sequence
->
origin
,
0
);
}
if
(
descriptor
->
aspect_ratio
.
num
&&
descriptor
->
aspect_ratio
.
den
)
st
->
display_aspect_ratio
=
descriptor
->
aspect_ratio
;
}
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
container_ul
=
mxf_get_codec_ul
(
mxf_sound_essence_container_uls
,
essence_container_ul
);
/* Only overwrite existing codec ID if it is unset or A-law, which is the default according to SMPTE RP 224. */
...
...
libavformat/utils.c
View file @
92c07acc
...
...
@@ -3347,6 +3347,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
st
->
r_frame_rate
.
den
=
st
->
time_base
.
num
;
}
}
if
(
st
->
display_aspect_ratio
.
num
&&
st
->
display_aspect_ratio
.
den
)
{
AVRational
hw_ratio
=
{
st
->
codec
->
height
,
st
->
codec
->
width
};
st
->
sample_aspect_ratio
=
av_mul_q
(
st
->
display_aspect_ratio
,
hw_ratio
);
}
}
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
if
(
!
st
->
codec
->
bits_per_coded_sample
)
st
->
codec
->
bits_per_coded_sample
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment