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
f4805328
Commit
f4805328
authored
Aug 29, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: move rate_emu to options context.
Make it work properly with multiple input files.
parent
96139b5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
avconv.c
avconv.c
+12
-8
No files found.
avconv.c
View file @
f4805328
...
...
@@ -161,8 +161,6 @@ static FILE *vstats_file;
static
int
opt_programid
=
0
;
static
int
copy_initial_nonkeyframes
=
0
;
static
int
rate_emu
=
0
;
static
int
audio_volume
=
256
;
static
int
exit_on_error
=
0
;
...
...
@@ -217,6 +215,7 @@ typedef struct InputFile {
int64_t
ts_offset
;
int
nb_streams
;
/* number of stream that avconv is aware of; may be different
from ctx.nb_streams if new streams appear during av_read_frame() */
int
rate_emu
;
}
InputFile
;
typedef
struct
OutputStream
{
...
...
@@ -305,6 +304,7 @@ typedef struct OptionsContext {
/* input options */
int64_t
input_ts_offset
;
int
rate_emu
;
SpecifierOpt
*
ts_scale
;
int
nb_ts_scale
;
...
...
@@ -1680,7 +1680,7 @@ static int output_packet(InputStream *ist, int ist_index,
}
/* frame rate emulation */
if
(
rate_emu
)
{
if
(
input_files
[
ist
->
file_index
].
rate_emu
)
{
int64_t
pts
=
av_rescale
(
ist
->
pts
,
1000000
,
AV_TIME_BASE
);
int64_t
now
=
av_gettime
()
-
ist
->
start
;
if
(
pts
>
now
)
...
...
@@ -1897,7 +1897,7 @@ static int transcode_init(OutputFile *output_files,
InputFile
*
input_files
,
int
nb_input_files
)
{
int
ret
=
0
,
i
;
int
ret
=
0
,
i
,
j
;
AVFormatContext
*
os
;
AVCodecContext
*
codec
,
*
icodec
;
OutputStream
*
ost
;
...
...
@@ -1905,9 +1905,13 @@ static int transcode_init(OutputFile *output_files,
char
error
[
1024
];
int
want_sdp
=
1
;
if
(
rate_emu
)
for
(
i
=
0
;
i
<
nb_input_streams
;
i
++
)
input_streams
[
i
].
start
=
av_gettime
();
/* init framerate emulation */
for
(
i
=
0
;
i
<
nb_input_files
;
i
++
)
{
InputFile
*
ifile
=
&
input_files
[
i
];
if
(
ifile
->
rate_emu
)
for
(
j
=
0
;
j
<
ifile
->
nb_streams
;
j
++
)
input_streams
[
j
+
ifile
->
ist_index
].
start
=
av_gettime
();
}
/* output stream init */
for
(
i
=
0
;
i
<
nb_output_files
;
i
++
)
{
...
...
@@ -4067,7 +4071,7 @@ static const OptionDef options[] = {
"dump each input packet"
},
{
"hex"
,
OPT_BOOL
|
OPT_EXPERT
,
{(
void
*
)
&
do_hex_dump
},
"when dumping packets, also dump the payload"
},
{
"re"
,
OPT_BOOL
|
OPT_EXPERT
,
{(
void
*
)
&
rate_emu
},
"read input at native frame rate"
,
""
},
{
"re"
,
OPT_BOOL
|
OPT_EXPERT
|
OPT_OFFSET
,
{.
off
=
OFFSET
(
rate_emu
)
},
"read input at native frame rate"
,
""
},
{
"v"
,
HAS_ARG
,
{(
void
*
)
opt_verbose
},
"set the verbosity level"
,
"number"
},
{
"target"
,
HAS_ARG
|
OPT_FUNC2
,
{(
void
*
)
opt_target
},
"specify target file type (
\"
vcd
\"
,
\"
svcd
\"
,
\"
dvd
\"
,
\"
dv
\"
,
\"
dv50
\"
,
\"
pal-vcd
\"
,
\"
ntsc-svcd
\"
, ...)"
,
"type"
},
{
"vsync"
,
HAS_ARG
|
OPT_INT
|
OPT_EXPERT
,
{(
void
*
)
&
video_sync_method
},
"video sync method"
,
""
},
...
...
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