Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
7a6bd541
Commit
7a6bd541
authored
Sep 30, 2014
by
Petri Hintukainen
Committed by
Paul B Mahol
Sep 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SUP/PGS subtitle muxer
Fixes ticket #2208
parent
ab96e2ca
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
3 deletions
+101
-3
Changelog
Changelog
+1
-0
general.texi
doc/general.texi
+1
-1
Makefile
libavformat/Makefile
+1
-0
allformats.c
libavformat/allformats.c
+1
-1
supenc.c
libavformat/supenc.c
+96
-0
version.h
libavformat/version.h
+1
-1
No files found.
Changelog
View file @
7a6bd541
...
...
@@ -44,6 +44,7 @@ version <next>:
- drop deprecated qtkit input device (use avfoundation instead)
- despill video filter
- haas audio filter
- SUP/PGS subtitle muxer
version 3.3:
- CrystalHD decoder moved to new decode API
...
...
doc/general.texi
View file @
7a6bd541
...
...
@@ -530,7 +530,7 @@ library:
@item Sony Wave64 (W64) @tab X @tab X
@item SoX native format @tab X @tab X
@item SUN AU format @tab X @tab X
@item SUP raw PGS subtitles @tab
@tab X
@item SUP raw PGS subtitles @tab
X
@tab X
@item SVAG @tab @tab X
@tab Audio format used in Konami PS2 games.
@item TDSC @tab @tab X
...
...
libavformat/Makefile
View file @
7a6bd541
...
...
@@ -474,6 +474,7 @@ OBJS-$(CONFIG_STR_DEMUXER) += psxstr.o
OBJS-$(CONFIG_SUBVIEWER1_DEMUXER)
+=
subviewer1dec.o
subtitles.o
OBJS-$(CONFIG_SUBVIEWER_DEMUXER)
+=
subviewerdec.o
subtitles.o
OBJS-$(CONFIG_SUP_DEMUXER)
+=
supdec.o
OBJS-$(CONFIG_SUP_MUXER)
+=
supenc.o
OBJS-$(CONFIG_SVAG_DEMUXER)
+=
svag.o
OBJS-$(CONFIG_SWF_DEMUXER)
+=
swfdec.o
swf.o
OBJS-$(CONFIG_SWF_MUXER)
+=
swfenc.o
swf.o
...
...
libavformat/allformats.c
View file @
7a6bd541
...
...
@@ -303,7 +303,7 @@ static void register_all(void)
REGISTER_DEMUXER
(
STL
,
stl
);
REGISTER_DEMUXER
(
SUBVIEWER1
,
subviewer1
);
REGISTER_DEMUXER
(
SUBVIEWER
,
subviewer
);
REGISTER_
DEMUXER
(
SUP
,
sup
);
REGISTER_
MUXDEMUX
(
SUP
,
sup
);
REGISTER_DEMUXER
(
SVAG
,
svag
);
REGISTER_MUXDEMUX
(
SWF
,
swf
);
REGISTER_DEMUXER
(
TAK
,
tak
);
...
...
libavformat/supenc.c
0 → 100644
View file @
7a6bd541
/*
* SUP muxer
* Copyright (c) 2014 Petri Hintukainen <phintuka@users.sourceforge.net>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
#define SUP_PGS_MAGIC 0x5047
/* "PG", big endian */
static
int
sup_write_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
uint8_t
*
data
=
pkt
->
data
;
size_t
size
=
pkt
->
size
;
uint32_t
pts
=
0
,
dts
=
0
;
if
(
pkt
->
pts
!=
AV_NOPTS_VALUE
)
{
pts
=
(
uint32_t
)
pkt
->
pts
;
}
if
(
pkt
->
dts
!=
AV_NOPTS_VALUE
)
{
dts
=
(
uint32_t
)
pkt
->
dts
;
}
/*
Split frame to segments.
mkvmerge stores multiple segments in one frame.
*/
while
(
size
>
2
)
{
size_t
len
=
AV_RB16
(
data
+
1
)
+
3
;
if
(
len
>
size
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Not enough data, skipping %d bytes
\n
"
,
(
int
)
size
);
return
AVERROR_INVALIDDATA
;
}
/* header */
avio_wb16
(
s
->
pb
,
SUP_PGS_MAGIC
);
avio_wb32
(
s
->
pb
,
pts
);
avio_wb32
(
s
->
pb
,
dts
);
avio_write
(
s
->
pb
,
data
,
len
);
data
+=
len
;
size
-=
len
;
}
if
(
size
>
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Skipping %d bytes after last segment in frame
\n
"
,
(
int
)
size
);
return
AVERROR_INVALIDDATA
;
}
return
0
;
}
static
int
sup_write_header
(
AVFormatContext
*
s
)
{
if
(
s
->
nb_streams
!=
1
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"%s files have exactly one stream
\n
"
,
s
->
oformat
->
name
);
return
AVERROR
(
EINVAL
);
}
avpriv_set_pts_info
(
s
->
streams
[
0
],
32
,
1
,
90000
);
return
0
;
}
AVOutputFormat
ff_sup_muxer
=
{
.
name
=
"sup"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw HDMV Presentation Graphic Stream subtitles"
),
.
extensions
=
"sup"
,
.
mime_type
=
"application/x-pgs"
,
.
subtitle_codec
=
AV_CODEC_ID_HDMV_PGS_SUBTITLE
,
.
write_header
=
sup_write_header
,
.
write_packet
=
sup_write_packet
,
.
flags
=
AVFMT_VARIABLE_FPS
|
AVFMT_TS_NONSTRICT
,
};
libavformat/version.h
View file @
7a6bd541
...
...
@@ -32,7 +32,7 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 8
1
#define LIBAVFORMAT_VERSION_MINOR 8
2
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
...
...
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