From 08d62241a742a68cde7cce7ffb7de7ffa62e538c Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 12 Apr 2008 17:02:23 +0000 Subject: [PATCH] Removed support for mjpegtools <1.8. --- README | 7 ++----- generate_dvd.cpp | 13 ++----------- generate_dvd.hpp | 5 ++--- videolink.cpp | 11 +++-------- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/README b/README index 1f632c0..9ad7990 100644 --- a/README +++ b/README @@ -18,7 +18,7 @@ VideoLink depends on the following software: - dvdauthor - expat 1.x - Gtkmm 2.4 or later -- ffmpeg or mjpegtools +- ffmpeg or mjpegtools 1.8 or later - Mozilla 1.8 or later, or XULRunner - netpbm - Xvfb (from XFree86 or X.org) @@ -118,10 +118,7 @@ to the other pages and to the video files. By default, VideoLink now calls ffmpeg to generate MPEG-2 streams for menus. If you want it to use mjpegtools as it previously did, you -must add the option "--encoder mjpegtools". If you use mjpegtools -1.6.2 or earlier you must instead use "--encoder mjpegtools-old". -This is due to an incompatible change in the syntax of the ppmtoy4m -command between versions 1.6.2 and 1.8. +must add the option "--encoder mjpegtools". If this is successful you can then use mkisofs to create a DVD image from the output directory. Alternately you can write this directory diff --git a/generate_dvd.cpp b/generate_dvd.cpp index 6125738..06f74b4 100644 --- a/generate_dvd.cpp +++ b/generate_dvd.cpp @@ -255,23 +255,14 @@ void dvd_generator::generate_menu_vob(unsigned index, } else { - assert(encoder_ == mpeg_encoder_mjpegtools_old - || encoder_ == mpeg_encoder_mjpegtools_new); + assert(encoder_ == mpeg_encoder_mjpegtools); command_stream << "pngtopnm " << background_name << " | ppmtoy4m -v0 -n" << menu_duration_frames(frame_params_) << " -F" << frame_params_.rate_numer << ":" << frame_params_.rate_denom << " -A" << frame_params_.pixel_ratio_width << ":" << frame_params_.pixel_ratio_height - << " -Ip "; - // The chroma subsampling keywords changed between - // versions 1.6.2 and 1.8 of mjpegtools. There is no - // keyword that works with both. - if (encoder_ == mpeg_encoder_mjpegtools_old) - command_stream << "-S420_mpeg2"; - else - command_stream << "-S420mpeg2"; - command_stream << + << " -Ip -S420mpeg2" " | mpeg2enc -v0 -f8 -a2 -o/dev/stdout" " | mplex -v0 -f8 -o/dev/stdout /dev/stdin"; } diff --git a/generate_dvd.hpp b/generate_dvd.hpp index d768163..df68775 100644 --- a/generate_dvd.hpp +++ b/generate_dvd.hpp @@ -51,12 +51,11 @@ public: // unspecified; not compared!) }; - // We can try using any of these encoders to convert PNG to MPEG. + // We can try using either of these encoders to convert PNG to MPEG. enum mpeg_encoder { mpeg_encoder_ffmpeg, // ffmpeg - mpeg_encoder_mjpegtools_old, // mjpegtools before version 1.8 - mpeg_encoder_mjpegtools_new // mjpegtools from version 1.8 + mpeg_encoder_mjpegtools // mjpegtools from version 1.8 }; dvd_generator(const video::frame_params & frame_params, diff --git a/videolink.cpp b/videolink.cpp index cec4ecc..1d473fa 100644 --- a/videolink.cpp +++ b/videolink.cpp @@ -762,7 +762,7 @@ namespace "Usage: " << command_name << " [gtk-options] [--preview]\n" " [--video-std {525|525/60|NTSC|ntsc" " | 625|625/50|PAL|pal}]\n" - " [--encoder {mjpegtools|mjpegtools-old}]\n" + " [--encoder {ffmpeg|mjpegtools}]\n" " menu-url [output-dir]\n"; } @@ -913,14 +913,9 @@ int main(int argc, char ** argv) { encoder = dvd_generator::mpeg_encoder_ffmpeg; } - else if (std::strcmp(argv[argi + 1], "mjpegtools-old") == 0) + else if (std::strcmp(argv[argi + 1], "mjpegtools") == 0) { - encoder = dvd_generator::mpeg_encoder_mjpegtools_old; - } - else if (std::strcmp(argv[argi + 1], "mjpegtools") == 0 - || std::strcmp(argv[argi + 1], "mjpegtools-new") == 0) - { - encoder = dvd_generator::mpeg_encoder_mjpegtools_new; + encoder = dvd_generator::mpeg_encoder_mjpegtools; } else { -- 2.39.5