Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
de38e7c8
Commit
de38e7c8
authored
Apr 09, 2013
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: use a rational for -aspect option.
parent
b4eb06d3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
ffmpeg.c
ffmpeg.c
+3
-3
ffmpeg.h
ffmpeg.h
+1
-1
ffmpeg_opt.c
ffmpeg_opt.c
+1
-1
No files found.
ffmpeg.c
View file @
de38e7c8
...
@@ -1071,7 +1071,7 @@ static int reap_filters(void)
...
@@ -1071,7 +1071,7 @@ static int reap_filters(void)
switch
(
ost
->
filter
->
filter
->
inputs
[
0
]
->
type
)
{
switch
(
ost
->
filter
->
filter
->
inputs
[
0
]
->
type
)
{
case
AVMEDIA_TYPE_VIDEO
:
case
AVMEDIA_TYPE_VIDEO
:
filtered_frame
->
pts
=
frame_pts
;
filtered_frame
->
pts
=
frame_pts
;
if
(
!
ost
->
frame_aspect_ratio
)
if
(
!
ost
->
frame_aspect_ratio
.
num
)
ost
->
st
->
codec
->
sample_aspect_ratio
=
filtered_frame
->
sample_aspect_ratio
;
ost
->
st
->
codec
->
sample_aspect_ratio
=
filtered_frame
->
sample_aspect_ratio
;
do_video_out
(
of
->
ctx
,
ost
,
filtered_frame
);
do_video_out
(
of
->
ctx
,
ost
,
filtered_frame
);
...
@@ -2300,8 +2300,8 @@ static int transcode_init(void)
...
@@ -2300,8 +2300,8 @@ static int transcode_init(void)
codec
->
width
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
w
;
codec
->
width
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
w
;
codec
->
height
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
h
;
codec
->
height
=
ost
->
filter
->
filter
->
inputs
[
0
]
->
h
;
codec
->
sample_aspect_ratio
=
ost
->
st
->
sample_aspect_ratio
=
codec
->
sample_aspect_ratio
=
ost
->
st
->
sample_aspect_ratio
=
ost
->
frame_aspect_ratio
?
// overridden by the -aspect cli option
ost
->
frame_aspect_ratio
.
num
?
// overridden by the -aspect cli option
av_
d2q
(
ost
->
frame_aspect_ratio
*
codec
->
height
/
codec
->
width
,
255
)
:
av_
mul_q
(
ost
->
frame_aspect_ratio
,
(
AVRational
){
codec
->
height
,
codec
->
width
}
)
:
ost
->
filter
->
filter
->
inputs
[
0
]
->
sample_aspect_ratio
;
ost
->
filter
->
filter
->
inputs
[
0
]
->
sample_aspect_ratio
;
if
(
!
strncmp
(
ost
->
enc
->
name
,
"libx264"
,
7
)
&&
if
(
!
strncmp
(
ost
->
enc
->
name
,
"libx264"
,
7
)
&&
codec
->
pix_fmt
==
AV_PIX_FMT_NONE
&&
codec
->
pix_fmt
==
AV_PIX_FMT_NONE
&&
...
...
ffmpeg.h
View file @
de38e7c8
...
@@ -331,7 +331,7 @@ typedef struct OutputStream {
...
@@ -331,7 +331,7 @@ typedef struct OutputStream {
int
force_fps
;
int
force_fps
;
int
top_field_first
;
int
top_field_first
;
float
frame_aspect_ratio
;
AVRational
frame_aspect_ratio
;
/* forced key frames */
/* forced key frames */
int64_t
*
forced_kf_pts
;
int64_t
*
forced_kf_pts
;
...
...
ffmpeg_opt.c
View file @
de38e7c8
...
@@ -1203,7 +1203,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
...
@@ -1203,7 +1203,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
av_log
(
NULL
,
AV_LOG_FATAL
,
"Invalid aspect ratio: %s
\n
"
,
frame_aspect_ratio
);
av_log
(
NULL
,
AV_LOG_FATAL
,
"Invalid aspect ratio: %s
\n
"
,
frame_aspect_ratio
);
exit
(
1
);
exit
(
1
);
}
}
ost
->
frame_aspect_ratio
=
av_q2d
(
q
)
;
ost
->
frame_aspect_ratio
=
q
;
}
}
video_enc
->
bits_per_raw_sample
=
frame_bits_per_raw_sample
;
video_enc
->
bits_per_raw_sample
=
frame_bits_per_raw_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