X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=blobdiff_plain;f=webdvd.cpp;h=f8e44005f204f24bcd80a7196e126dad7ff97c6b;hp=5fd5e6ff8774a34bbb70345a2c8d32e5af05da3b;hb=388aa3e7fbf7d7586c998833ab53712a88c8d46a;hpb=e1c65f7da2e82bcd2e61886ae5b329a7211ba124 diff --git a/webdvd.cpp b/webdvd.cpp index 5fd5e6f..f8e4400 100644 --- a/webdvd.cpp +++ b/webdvd.cpp @@ -71,7 +71,7 @@ namespace // We can try using any of these encoders to convert PNG to MPEG. enum mpeg_encoder { - mpeg_encoder_ffmpeg, // ffmpeg - doesn't work yet + mpeg_encoder_ffmpeg, // ffmpeg mpeg_encoder_mjpegtools_old, // mjpegtools before version 1.8 mpeg_encoder_mjpegtools_new // mjpegtools from version 1.8 }; @@ -753,7 +753,7 @@ namespace << "ffmpeg" << " -f image2 -vcodec png -i " << background_temp_->get_name() - << " -target " << frame_params_.name << "-dvd" + << " -target " << frame_params_.ffmpeg_name << "-dvd" << " -vcodec mpeg2video -an -y /dev/stdout" << " | spumux -v0 -mdvd " << state->spumux_temp.get_name() << " > " << contents_.menus[menu_num].vob_temp->get_name(); @@ -808,22 +808,19 @@ namespace const video::frame_params & lookup_frame_params(const char * str) { assert(str); - static const struct { const char * str; bool is_ntsc; } - known_strings[] = { - { "NTSC", true }, - { "ntsc", true }, - { "PAL", false }, - { "pal", false }, - // For DVD purposes, SECAM can be treated identically to PAL. - { "SECAM", false }, - { "secam", false } + static const char * const known_strings[] = { + "525", "625", + "525/60", "625/50", + "NTSC", "PAL", + "ntsc", "pal" }; for (std::size_t i = 0; i != sizeof(known_strings)/sizeof(known_strings[0]); ++i) - if (std::strcmp(str, known_strings[i].str) == 0) - return known_strings[i].is_ntsc ? - video::ntsc_params : video::pal_params; + if (std::strcmp(str, known_strings[i]) == 0) + return (i & 1) + ? video::frame_params_625 + : video::frame_params_525; throw std::runtime_error( std::string("Invalid video standard: ").append(str)); } @@ -832,9 +829,10 @@ namespace { stream << "Usage: " << command_name << " [gtk-options] [--preview]\n" - " [--video-std {ntsc|pal|secam}]\n" + " [--video-std {525|525/60|NTSC|ntsc" + " | 625|625/50|PAL|pal}]\n" " [--encoder {mjpegtools|mjpegtools-old}]\n" - " menu-url [output-dir]\n"); + " menu-url [output-dir]\n"; } void set_browser_preferences() @@ -882,11 +880,11 @@ int main(int argc, char ** argv) { try { - video::frame_params frame_params = video::pal_params; + video::frame_params frame_params = video::frame_params_625; bool preview_mode = false; std::string menu_url; std::string output_dir; - mpeg_encoder encoder = mpeg_encoder_mjpegtools_new; + mpeg_encoder encoder = mpeg_encoder_ffmpeg; // Do initial option parsing. We have to do this before // letting Gtk parse the arguments since we may need to spawn