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
d6af706e
Commit
d6af706e
authored
Aug 08, 2014
by
Mark Reid
Committed by
Michael Niedermayer
Aug 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/movenc: write reel_name metadata to tmcd atom
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
4b63bcef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
movenc.c
libavformat/movenc.c
+23
-2
No files found.
libavformat/movenc.c
View file @
d6af706e
...
...
@@ -1340,12 +1340,23 @@ static int mov_write_rtp_tag(AVIOContext *pb, MOVTrack *track)
return
update_size
(
pb
,
pos
);
}
static
int
mov_write_source_reference_tag
(
AVIOContext
*
pb
,
MOVTrack
*
track
,
const
char
*
reel_name
){
int64_t
pos
=
avio_tell
(
pb
);
avio_wb32
(
pb
,
0
);
/* size */
ffio_wfourcc
(
pb
,
"name"
);
/* Data format */
avio_wb16
(
pb
,
strlen
(
reel_name
));
/* string size */
avio_wb16
(
pb
,
track
->
language
);
/* langcode */
avio_write
(
pb
,
reel_name
,
strlen
(
reel_name
));
/* reel name */
return
update_size
(
pb
,
pos
);
}
static
int
mov_write_tmcd_tag
(
AVIOContext
*
pb
,
MOVTrack
*
track
)
{
int64_t
pos
=
avio_tell
(
pb
);
#if 1
int
frame_duration
=
av_rescale
(
track
->
timescale
,
track
->
enc
->
time_base
.
num
,
track
->
enc
->
time_base
.
den
);
int
nb_frames
=
1
.
0
/
av_q2d
(
track
->
enc
->
time_base
)
+
0
.
5
;
AVDictionaryEntry
*
t
=
NULL
;
if
(
nb_frames
>
255
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"fps %d is too large
\n
"
,
nb_frames
);
...
...
@@ -1361,8 +1372,15 @@ static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track)
avio_wb32
(
pb
,
track
->
timescale
);
/* Timescale */
avio_wb32
(
pb
,
frame_duration
);
/* Frame duration */
avio_w8
(
pb
,
nb_frames
);
/* Number of frames */
avio_wb24
(
pb
,
0
);
/* Reserved */
/* TODO: source reference string */
avio_w8
(
pb
,
0
);
/* Reserved */
if
(
track
->
st
)
t
=
av_dict_get
(
track
->
st
->
metadata
,
"reel_name"
,
NULL
,
0
);
if
(
t
&&
utf8len
(
t
->
value
))
mov_write_source_reference_tag
(
pb
,
track
,
t
->
value
);
else
avio_wb16
(
pb
,
0
);
/* zero size */
#else
avio_wb32
(
pb
,
0
);
/* size */
...
...
@@ -3809,6 +3827,9 @@ static int mov_create_timecode_track(AVFormatContext *s, int index, int src_inde
if
(
tc
.
flags
&
AV_TIMECODE_FLAG_DROPFRAME
)
track
->
timecode_flags
|=
MOV_TIMECODE_FLAG_DROPFRAME
;
/* set st to src_st for metadata access*/
track
->
st
=
src_st
;
/* encode context: tmcd data stream */
track
->
enc
=
avcodec_alloc_context3
(
NULL
);
track
->
enc
->
codec_type
=
AVMEDIA_TYPE_DATA
;
...
...
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