Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
external
ffmpeg
Commits
3c0df905
Commit
3c0df905
authored
Aug 11, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: make -shortest a per-output file option.
parent
91e59fea
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
10 deletions
+15
-10
Changelog
Changelog
+1
-0
avconv.c
avconv.c
+8
-7
avconv.h
avconv.h
+3
-1
avconv_opt.c
avconv_opt.c
+2
-1
doc/avconv.texi
doc/avconv.texi
+1
-1
No files found.
Changelog
View file @
3c0df905
...
...
@@ -42,6 +42,7 @@ version <next>:
- RTMPE protocol support
- RTMPTE protocol support
- Canopus Lossless Codec decoder
- avconv -shortest option is now per-output file
version 0.8:
...
...
avconv.c
View file @
3c0df905
...
...
@@ -719,7 +719,7 @@ static int poll_filter(OutputStream *ost)
*/
static
int
poll_filters
(
void
)
{
int
i
,
ret
=
0
;
int
i
,
j
,
ret
=
0
;
while
(
ret
>=
0
&&
!
received_sigterm
)
{
OutputStream
*
ost
=
NULL
;
...
...
@@ -746,10 +746,14 @@ static int poll_filters(void)
ret
=
poll_filter
(
ost
);
if
(
ret
==
AVERROR_EOF
)
{
OutputFile
*
of
=
output_files
[
ost
->
file_index
];
ost
->
finished
=
1
;
if
(
opt_shortest
)
return
ret
;
if
(
of
->
shortest
)
{
for
(
j
=
0
;
j
<
of
->
ctx
->
nb_streams
;
j
++
)
output_streams
[
of
->
ost_index
+
j
]
->
finished
=
1
;
}
ret
=
0
;
}
else
if
(
ret
==
AVERROR
(
EAGAIN
))
...
...
@@ -2170,10 +2174,7 @@ static int process_input(void)
}
}
if
(
opt_shortest
)
return
AVERROR_EOF
;
else
return
AVERROR
(
EAGAIN
);
return
AVERROR
(
EAGAIN
);
}
reset_eagain
();
...
...
avconv.h
View file @
3c0df905
...
...
@@ -113,6 +113,7 @@ typedef struct OptionsContext {
uint64_t
limit_filesize
;
float
mux_preload
;
float
mux_max_delay
;
int
shortest
;
int
video_disable
;
int
audio_disable
;
...
...
@@ -303,6 +304,8 @@ typedef struct OutputFile {
int64_t
recording_time
;
/* desired length of the resulting file in microseconds */
int64_t
start_time
;
/* start time in microseconds */
uint64_t
limit_filesize
;
int
shortest
;
}
OutputFile
;
extern
InputStream
**
input_streams
;
...
...
@@ -333,7 +336,6 @@ extern int do_hex_dump;
extern
int
do_pkt_dump
;
extern
int
copy_ts
;
extern
int
copy_tb
;
extern
int
opt_shortest
;
extern
int
exit_on_error
;
extern
int
print_stats
;
extern
int
qp_hist
;
...
...
avconv_opt.c
View file @
3c0df905
...
...
@@ -1352,6 +1352,7 @@ loop_end:
oc
->
duration
=
o
->
recording_time
;
output_files
[
nb_output_files
-
1
]
->
start_time
=
o
->
start_time
;
output_files
[
nb_output_files
-
1
]
->
limit_filesize
=
o
->
limit_filesize
;
output_files
[
nb_output_files
-
1
]
->
shortest
=
o
->
shortest
;
av_dict_copy
(
&
output_files
[
nb_output_files
-
1
]
->
opts
,
format_opts
,
0
);
/* check filename in case of an image number is expected */
...
...
@@ -1836,7 +1837,7 @@ const OptionDef options[] = {
{
"adrift_threshold"
,
HAS_ARG
|
OPT_FLOAT
|
OPT_EXPERT
,
{(
void
*
)
&
audio_drift_threshold
},
"audio drift threshold"
,
"threshold"
},
{
"copyts"
,
OPT_BOOL
|
OPT_EXPERT
,
{(
void
*
)
&
copy_ts
},
"copy timestamps"
},
{
"copytb"
,
OPT_BOOL
|
OPT_EXPERT
,
{(
void
*
)
&
copy_tb
},
"copy input stream time base when stream copying"
},
{
"shortest"
,
OPT_BOOL
|
OPT_EXPERT
,
{(
void
*
)
&
opt_
shortest
},
"finish encoding within shortest input"
},
//
{
"shortest"
,
OPT_BOOL
|
OPT_EXPERT
|
OPT_OFFSET
,
{.
off
=
OFFSET
(
shortest
)
},
"finish encoding within shortest input"
},
{
"dts_delta_threshold"
,
HAS_ARG
|
OPT_FLOAT
|
OPT_EXPERT
,
{(
void
*
)
&
dts_delta_threshold
},
"timestamp discontinuity delta threshold"
,
"threshold"
},
{
"xerror"
,
OPT_BOOL
,
{(
void
*
)
&
exit_on_error
},
"exit on error"
,
"error"
},
{
"copyinkf"
,
OPT_BOOL
|
OPT_EXPERT
|
OPT_SPEC
,
{.
off
=
OFFSET
(
copy_initial_nonkeyframes
)},
"copy initial non-keyframes"
},
...
...
doc/avconv.texi
View file @
3c0df905
...
...
@@ -752,7 +752,7 @@ This option has been deprecated. Use the @code{asyncts} audio filter instead.
Copy timestamps from input to output.
@item -copytb
Copy input stream time base from input to output when stream copying.
@item -shortest
@item -shortest
(@emph
{
output
}
)
Finish encoding when the shortest input stream ends.
@item -dts
_
delta
_
threshold
Timestamp discontinuity delta threshold.
...
...
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