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
538bf767
Commit
538bf767
authored
May 26, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: make -aspect work with streamcopy
parent
564b7e0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
avconv.c
avconv.c
+8
-7
avconv_opt.c
avconv_opt.c
+6
-5
No files found.
avconv.c
View file @
538bf767
...
...
@@ -1490,6 +1490,7 @@ static int transcode_init(void)
}
if
(
ost
->
stream_copy
)
{
AVRational
sar
;
uint64_t
extra_size
;
av_assert0
(
ist
&&
!
ost
->
filter
);
...
...
@@ -1547,13 +1548,13 @@ static int transcode_init(void)
codec
->
width
=
icodec
->
width
;
codec
->
height
=
icodec
->
height
;
codec
->
has_b_frames
=
icodec
->
has_b_frames
;
if
(
!
codec
->
sample_aspect_ratio
.
num
)
{
codec
->
sample_aspect_ratio
=
ost
->
st
->
sample_aspect_ratio
=
ist
->
st
->
sample_aspect_ratio
.
num
?
ist
->
st
->
sample_aspect_ratio
:
ist
->
st
->
codec
->
sample_aspect_ratio
.
num
?
ist
->
st
->
codec
->
sample_aspect_ratio
:
(
AVRational
){
0
,
1
}
;
}
if
(
ost
->
frame_aspect_ratio
)
sar
=
av_d2q
(
ost
->
frame_aspect_ratio
*
codec
->
height
/
codec
->
width
,
255
);
else
if
(
ist
->
st
->
sample_aspect_ratio
.
num
)
sar
=
ist
->
st
->
sample_aspect_ratio
;
else
sar
=
icodec
->
sample_aspect_ratio
;
ost
->
st
->
sample_aspect_ratio
=
codec
->
sample_aspect_ratio
=
sar
;
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
codec
->
width
=
icodec
->
width
;
...
...
avconv_opt.c
View file @
538bf767
...
...
@@ -983,15 +983,20 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
AVStream
*
st
;
OutputStream
*
ost
;
AVCodecContext
*
video_enc
;
char
*
frame_aspect_ratio
=
NULL
;
ost
=
new_output_stream
(
o
,
oc
,
AVMEDIA_TYPE_VIDEO
);
st
=
ost
->
st
;
video_enc
=
st
->
codec
;
MATCH_PER_STREAM_OPT
(
frame_aspect_ratios
,
str
,
frame_aspect_ratio
,
oc
,
st
);
if
(
frame_aspect_ratio
)
ost
->
frame_aspect_ratio
=
parse_frame_aspect_ratio
(
frame_aspect_ratio
);
if
(
!
ost
->
stream_copy
)
{
const
char
*
p
=
NULL
;
char
*
frame_rate
=
NULL
,
*
frame_size
=
NULL
;
char
*
frame_
aspect_ratio
=
NULL
,
*
frame_
pix_fmt
=
NULL
;
char
*
frame_pix_fmt
=
NULL
;
char
*
intra_matrix
=
NULL
,
*
inter_matrix
=
NULL
;
int
do_pass
=
0
;
int
i
;
...
...
@@ -1008,10 +1013,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
exit
(
1
);
}
MATCH_PER_STREAM_OPT
(
frame_aspect_ratios
,
str
,
frame_aspect_ratio
,
oc
,
st
);
if
(
frame_aspect_ratio
)
ost
->
frame_aspect_ratio
=
parse_frame_aspect_ratio
(
frame_aspect_ratio
);
MATCH_PER_STREAM_OPT
(
frame_pix_fmts
,
str
,
frame_pix_fmt
,
oc
,
st
);
if
(
frame_pix_fmt
&&
(
video_enc
->
pix_fmt
=
av_get_pix_fmt
(
frame_pix_fmt
))
==
AV_PIX_FMT_NONE
)
{
av_log
(
NULL
,
AV_LOG_FATAL
,
"Unknown pixel format requested: %s.
\n
"
,
frame_pix_fmt
);
...
...
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