aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Curtis <pfc@terrapin.com>2004-10-03 18:21:45 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-10-03 18:21:45 +0000
commit78a0efb4fce5deb82050acaf51088747662fbfe0 (patch)
treed4933d3ea95b4368d60af72101fe2fe84b807641
parentf20ad5534a092109ed7d6c644ce74d7f50611fdb (diff)
downloadffmpeg-78a0efb4fce5deb82050acaf51088747662fbfe0.tar.gz
AVOutputFormat mpeg2dvd_mux and int is_dvd from the dvd patch by (Paul Curtis <pfc at terrapin dot com>)
Originally committed as revision 3557 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c2
-rw-r--r--libavformat/mpeg.c20
2 files changed, 19 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 0467528fab..4cca20ec0a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3672,7 +3672,7 @@ static void opt_target(const char *arg)
opt_video_codec("mpeg2video");
opt_audio_codec("ac3");
- opt_format("vob");
+ opt_format("dvd");
opt_frame_size(norm ? "720x480" : "720x576");
opt_gop_size(norm ? "18" : "15");
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 8a2d27e793..4ee74cdc1a 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -60,6 +60,7 @@ typedef struct {
int is_mpeg2;
int is_vcd;
int is_svcd;
+ int is_dvd;
int64_t last_scr; /* current system clock */
double vcd_padding_bitrate; //FIXME floats
@@ -94,6 +95,7 @@ static AVOutputFormat mpeg1system_mux;
static AVOutputFormat mpeg1vcd_mux;
static AVOutputFormat mpeg2vob_mux;
static AVOutputFormat mpeg2svcd_mux;
+static AVOutputFormat mpeg2dvd_mux;
static int put_pack_header(AVFormatContext *ctx,
uint8_t *buf, int64_t timestamp)
@@ -251,7 +253,8 @@ static int mpeg_mux_init(AVFormatContext *ctx)
s->packet_number = 0;
s->is_vcd = (ctx->oformat == &mpeg1vcd_mux);
s->is_svcd = (ctx->oformat == &mpeg2svcd_mux);
- s->is_mpeg2 = (ctx->oformat == &mpeg2vob_mux || ctx->oformat == &mpeg2svcd_mux);
+ s->is_mpeg2 = (ctx->oformat == &mpeg2vob_mux || ctx->oformat == &mpeg2svcd_mux || ctx->oformat == &mpeg2dvd_mux);
+ s->is_dvd = (ctx->oformat == &mpeg2dvd_mux);
if (s->is_vcd || s->is_svcd)
s->packet_size = 2324; /* VCD/SVCD packet size */
@@ -1512,7 +1515,19 @@ static AVOutputFormat mpeg2svcd_mux = {
mpeg_mux_end,
};
-
+/* Same as mpeg2vob_mux except the 'is_dvd' flag is set to produce NAV pkts */
+static AVOutputFormat mpeg2dvd_mux = {
+ "dvd",
+ "MPEG2 PS format (DVD VOB)",
+ "video/mpeg",
+ "dvd",
+ sizeof(MpegMuxContext),
+ CODEC_ID_MP2,
+ CODEC_ID_MPEG2VIDEO,
+ mpeg_mux_init,
+ mpeg_mux_write_packet,
+ mpeg_mux_end,
+};
#endif //CONFIG_ENCODERS
@@ -1535,6 +1550,7 @@ int mpegps_init(void)
av_register_output_format(&mpeg1vcd_mux);
av_register_output_format(&mpeg2vob_mux);
av_register_output_format(&mpeg2svcd_mux);
+ av_register_output_format(&mpeg2dvd_mux);
#endif //CONFIG_ENCODERS
av_register_input_format(&mpegps_demux);
return 0;