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
d831edc3
Commit
d831edc3
authored
Sep 09, 2019
by
Gyan Doshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avdevice/decklink: add option to drop frames till timecode is seen
Option wait_for_tc only takes effect if tc_format is set
parent
cda3e8ca
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
1 deletion
+22
-1
indevs.texi
doc/indevs.texi
+8
-0
decklink_common.h
libavdevice/decklink_common.h
+1
-0
decklink_common_c.h
libavdevice/decklink_common_c.h
+1
-0
decklink_dec.cpp
libavdevice/decklink_dec.cpp
+10
-0
decklink_dec_c.c
libavdevice/decklink_dec_c.c
+1
-0
version.h
libavdevice/version.h
+1
-1
No files found.
doc/indevs.texi
View file @
d831edc3
...
...
@@ -395,6 +395,14 @@ Either sync could go wrong by 1 frame or in a rarer case
@option{timestamp_align} seconds.
Defaults to @samp{0}.
@item wait_for_tc (@emph{bool})
Drop frames till a frame with timecode is received. Sometimes serial timecode
isn't received with the first input frame. If that happens, the stored stream
timecode will be inaccurate. If this option is set to @option{true}, input frames
are dropped till a frame with timecode is received.
Option @var{timecode_format} must be specified.
Defaults to @option{false}.
@end table
@subsection Examples
...
...
libavdevice/decklink_common.h
View file @
d831edc3
...
...
@@ -149,6 +149,7 @@ struct decklink_ctx {
int
channels
;
int
audio_depth
;
unsigned
long
tc_seen
;
// used with option wait_for_tc
};
typedef
enum
{
DIRECTION_IN
,
DIRECTION_OUT
}
decklink_direction_t
;
...
...
libavdevice/decklink_common_c.h
View file @
d831edc3
...
...
@@ -58,6 +58,7 @@ struct decklink_cctx {
int
copyts
;
int64_t
timestamp_align
;
int
timing_offset
;
int
wait_for_tc
;
};
#endif
/* AVDEVICE_DECKLINK_COMMON_C_H */
libavdevice/decklink_dec.cpp
View file @
d831edc3
...
...
@@ -784,6 +784,8 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
if
(
packed_metadata
)
{
if
(
av_packet_add_side_data
(
&
pkt
,
AV_PKT_DATA_STRINGS_METADATA
,
packed_metadata
,
metadata_len
)
<
0
)
av_freep
(
&
packed_metadata
);
else
if
(
!
ctx
->
tc_seen
)
ctx
->
tc_seen
=
ctx
->
frameCount
;
}
}
}
...
...
@@ -793,6 +795,14 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
}
}
if
(
ctx
->
tc_format
&&
cctx
->
wait_for_tc
&&
!
ctx
->
tc_seen
)
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"No TC detected yet. wait_for_tc set. Dropping.
\n
"
);
av_log
(
avctx
,
AV_LOG_WARNING
,
"Frame received (#%lu) - "
"- Frames dropped %u
\n
"
,
ctx
->
frameCount
,
++
ctx
->
dropped
);
return
S_OK
;
}
pkt
.
pts
=
get_pkt_pts
(
videoFrame
,
audioFrame
,
wallclock
,
abs_wallclock
,
ctx
->
video_pts_source
,
ctx
->
video_st
->
time_base
,
&
initial_video_pts
,
cctx
->
copyts
);
pkt
.
dts
=
pkt
.
pts
;
...
...
libavdevice/decklink_dec_c.c
View file @
d831edc3
...
...
@@ -85,6 +85,7 @@ static const AVOption options[] = {
{
"audio_depth"
,
"audio bitdepth (16 or 32)"
,
OFFSET
(
audio_depth
),
AV_OPT_TYPE_INT
,
{
.
i64
=
16
},
16
,
32
,
DEC
},
{
"decklink_copyts"
,
"copy timestamps, do not remove the initial offset"
,
OFFSET
(
copyts
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
DEC
},
{
"timestamp_align"
,
"capture start time alignment (in seconds)"
,
OFFSET
(
timestamp_align
),
AV_OPT_TYPE_DURATION
,
{
.
i64
=
0
},
0
,
INT_MAX
,
DEC
},
{
"wait_for_tc"
,
"drop frames till a frame with timecode is received. TC format must be set"
,
OFFSET
(
wait_for_tc
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
DEC
},
{
NULL
},
};
...
...
libavdevice/version.h
View file @
d831edc3
...
...
@@ -29,7 +29,7 @@
#define LIBAVDEVICE_VERSION_MAJOR 58
#define LIBAVDEVICE_VERSION_MINOR 9
#define LIBAVDEVICE_VERSION_MICRO 10
0
#define LIBAVDEVICE_VERSION_MICRO 10
1
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
...
...
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