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
f9cc6883
Commit
f9cc6883
authored
Jan 14, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3enc: add an option for disabling the Xing frame.
parent
045654f4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
muxers.texi
doc/muxers.texi
+4
-3
mp3enc.c
libavformat/mp3enc.c
+4
-1
No files found.
doc/muxers.texi
View file @
f9cc6883
...
@@ -437,9 +437,10 @@ optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
...
@@ -437,9 +437,10 @@ optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
@code{id3v2_version} option controls which one is used. The legacy ID3v1 tag is
@code{id3v2_version} option controls which one is used. The legacy ID3v1 tag is
not written by default, but may be enabled with the @code{write_id3v1} option.
not written by default, but may be enabled with the @code{write_id3v1} option.
For seekable output the muxer also writes a Xing frame at the beginning, which
The muxer may also write a Xing frame at the beginning, which contains the
contains the number of frames in the file. It is useful for computing duration
number of frames in the file. It is useful for computing duration of VBR files.
of VBR files.
The Xing frame is written if the output stream is seekable and if the
@code{write_xing} option is set to 1 (the default).
The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
are supplied to the muxer in form of a video stream with a single packet. There
are supplied to the muxer in form of a video stream with a single packet. There
...
...
libavformat/mp3enc.c
View file @
f9cc6883
...
@@ -84,6 +84,7 @@ typedef struct MP3Context {
...
@@ -84,6 +84,7 @@ typedef struct MP3Context {
ID3v2EncContext
id3
;
ID3v2EncContext
id3
;
int
id3v2_version
;
int
id3v2_version
;
int
write_id3v1
;
int
write_id3v1
;
int
write_xing
;
/* xing header */
/* xing header */
int64_t
xing_offset
;
int64_t
xing_offset
;
...
@@ -121,7 +122,7 @@ static void mp3_write_xing(AVFormatContext *s)
...
@@ -121,7 +122,7 @@ static void mp3_write_xing(AVFormatContext *s)
int
xing_offset
;
int
xing_offset
;
int
ver
=
0
;
int
ver
=
0
;
if
(
!
s
->
pb
->
seekable
)
if
(
!
s
->
pb
->
seekable
||
!
mp3
->
write_xing
)
return
;
return
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
avpriv_mpa_freq_tab
);
i
++
)
{
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
avpriv_mpa_freq_tab
);
i
++
)
{
...
@@ -321,6 +322,8 @@ static const AVOption options[] = {
...
@@ -321,6 +322,8 @@ static const AVOption options[] = {
offsetof
(
MP3Context
,
id3v2_version
),
AV_OPT_TYPE_INT
,
{.
i64
=
4
},
3
,
4
,
AV_OPT_FLAG_ENCODING_PARAM
},
offsetof
(
MP3Context
,
id3v2_version
),
AV_OPT_TYPE_INT
,
{.
i64
=
4
},
3
,
4
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
"write_id3v1"
,
"Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software."
,
{
"write_id3v1"
,
"Enable ID3v1 writing. ID3v1 tags are written in UTF-8 which may not be supported by most software."
,
offsetof
(
MP3Context
,
write_id3v1
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
AV_OPT_FLAG_ENCODING_PARAM
},
offsetof
(
MP3Context
,
write_id3v1
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
"write_xing"
,
"Write the Xing header containing file duration."
,
offsetof
(
MP3Context
,
write_xing
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
1
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
NULL
},
{
NULL
},
};
};
...
...
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