RafaMar + programmer friend Help button in Batch Render addition
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / bdcreate.C
index 863c5d05b80ad7cb3b9b02c4d47c4b4c5bff8f2b..93794d516f842acea5469b703e9f36b3c1170afc 100644 (file)
@@ -41,9 +41,10 @@ static struct bd_format {
 } bd_formats[] = {
 // framerates are frames, not fields, per second, *=not standard
        { "1920x1080 29.97i",   1920,1080, 29.97,  1, ILACE_MODE_TOP_FIRST },
-       { "1920x1080 29.97p*",  1920,1080, 29.97,  1, ILACE_MODE_NOTINTERLACED },
+       { "1920x1080 29.97p*",  1920,1080, 29.97,  1, ILACE_MODE_FAKE_INTERLACE },
        { "1920x1080 24p",      1920,1080, 24.,    1, ILACE_MODE_NOTINTERLACED },
        { "1920x1080 25i",      1920,1080, 25.,    1, ILACE_MODE_TOP_FIRST },
+       { "1920x1080 25p*",     1920,1080, 25.,    1, ILACE_MODE_FAKE_INTERLACE },
        { "1920x1080 23.976p",  1920,1080, 23.976, 1, ILACE_MODE_NOTINTERLACED },
        { "1440x1080 29.97i",   1440,1080, 29.97, -1, ILACE_MODE_TOP_FIRST },
        { "1440x1080 25i",      1440,1080, 25.,   -1, ILACE_MODE_TOP_FIRST },
@@ -51,6 +52,8 @@ static struct bd_format {
        { "1440x1080 23.976p",  1440,1080, 23.976,-1, ILACE_MODE_NOTINTERLACED },
        { "1280x720  59.94p",   1280,720,  59.94,  1, ILACE_MODE_NOTINTERLACED },
        { "1280x720  50p",      1280,720,  50.,    1, ILACE_MODE_NOTINTERLACED },
+       { "1280x720  29.97p*",  1280,720,  29.97,  1, ILACE_MODE_NOTINTERLACED },
+       { "1280x720  25p*",     1280,720,  25.,    1, ILACE_MODE_NOTINTERLACED },
        { "1280x720  24p",      1280,720,  24.,    1, ILACE_MODE_NOTINTERLACED },
        { "1280x720  23.976p",  1280,720,  23.976, 1, ILACE_MODE_NOTINTERLACED },
        { "720x576   25i",       720,576,  25.,    0, ILACE_MODE_BOTTOM_FIRST },
@@ -77,9 +80,10 @@ const double CreateBD_Thread::BD_KAUDIO_RATE = 192;
 const int CreateBD_Thread::BD_INTERLACE_MODE = ILACE_MODE_NOTINTERLACED;
 
 CreateBD_MenuItem::CreateBD_MenuItem(MWindow *mwindow)
- : BC_MenuItem(_("BD Render..."), _("Ctrl-d"), 'd')
+ : BC_MenuItem(_("BD Render..."), _("Ctrl-Shift-D"), 'D')
 {
        set_ctrl(1);
+       set_shift(1);
        this->mwindow = mwindow;
 }
 
@@ -168,7 +172,7 @@ char *BD_BatchRenderJob::create_script(EDL *edl, ArrayList<Indexable *> *idxbls)
        fprintf(fp,"dir=`cd \"$sdir\"; pwd`\n");
        fprintf(fp,"PATH=$PATH:%s\n",exec_path);
        fprintf(fp,"mkdir -p $dir/udfs\n");
-       fprintf(fp,"sz=`du -cb $dir/bd.m2ts* | tail -1 | sed -e 's/[ \t].*//'`\n");
+       fprintf(fp,"sz=`du -cb $dir/bd.m2ts* | tail -1 | sed -e 's/[    ].*//'`\n");
        fprintf(fp,"blks=$((sz/2048 + 4096))\n");
        fprintf(fp,"rm -f %s\n", udfs);
        fprintf(fp,"mkudffs -b 2048 %s $blks\n", udfs);
@@ -320,21 +324,17 @@ int CreateBD_Thread::create_bd_jobs(ArrayList<BatchRenderJob*> *jobs, const char
        asset->ff_audio_bitrate = bd_kaudio_rate * 1000;
 
        asset->video_data = 1;
-       strcpy(asset->vcodec, "bluray.m2ts");
+       const char *vcodec = "bluray.m2ts";
+       switch( asset->interlace_mode ) {
+       case ILACE_MODE_TOP_FIRST:    vcodec = "bluray_tff.m2ts";  break;
+       case ILACE_MODE_BOTTOM_FIRST: vcodec = "bluray_bff.m2ts";  break;
+       case ILACE_MODE_FAKE_INTERLACE : vcodec = "bluray_fakeinterlace.m2ts";  break;
+       }
+       strcpy(asset->vcodec, vcodec);
        //mwindow->defaults->get("DEFAULT_BLURAY_VCODEC", asset->vcodec);
        FFMPEG::set_option_path(option_path, "video/%s", asset->vcodec);
        FFMPEG::load_options(option_path, asset->ff_video_options,
                 sizeof(asset->ff_video_options));
-       const char *opts = 0;
-       switch( asset->interlace_mode ) {
-       case ILACE_MODE_TOP_FIRST:    opts = ":tff\n";  break;
-       case ILACE_MODE_BOTTOM_FIRST: opts = ":bff\n";  break;
-       }
-       if( opts ) {
-               int len = strlen(asset->ff_video_options);
-               char *cp = asset->ff_video_options + len-1;
-               strncpy(cp, opts, sizeof(asset->ff_video_options)-len);
-       }
        asset->ff_video_bitrate = vid_bitrate;
        asset->ff_video_quality = -1;
        return 0;
@@ -364,7 +364,7 @@ void CreateBD_Thread::handle_close_event(int result)
                Tracks *tracks = mwindow->edl->tracks;
                for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
                        if( vtrk->data_type != TRACK_VIDEO ) continue;
-                       if( !vtrk->record ) continue;
+                       if( !vtrk->is_armed() ) continue;
                        vtrk->expand_view = 1;
                        PluginSet *plugin_set = new PluginSet(mwindow->edl, vtrk);
                        vtrk->plugin_set.append(plugin_set);
@@ -874,7 +874,7 @@ insert_video_plugin(const char *title, KeyFrame *default_keyframe)
        Tracks *tracks = mwindow->edl->tracks;
        for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
                if( vtrk->data_type != TRACK_VIDEO ) continue;
-               if( !vtrk->record ) continue;
+               if( !vtrk->is_armed() ) continue;
                vtrk->expand_view = 1;
                PluginSet *plugin_set = new PluginSet(mwindow->edl, vtrk);
                vtrk->plugin_set.append(plugin_set);
@@ -898,7 +898,7 @@ resize_tracks()
        if( trk_h < bd_height ) trk_h = bd_height;
        for( Track *vtrk=tracks->first; vtrk; vtrk=vtrk->next ) {
                if( vtrk->data_type != TRACK_VIDEO ) continue;
-               if( !vtrk->record ) continue;
+               if( !vtrk->is_armed() ) continue;
                vtrk->track_w = trk_w;
                vtrk->track_h = trk_h;
        }
@@ -933,7 +933,7 @@ option_presets()
        max_w = 0;  max_h = 0;
        int has_deinterlace = 0, has_scale = 0;
        for( Track *trk=tracks->first; trk; trk=trk->next ) {
-               if( !trk->record ) continue;
+               if( !trk->is_armed() ) continue;
                Edits *edits = trk->edits;
                switch( trk->data_type ) {
                case TRACK_VIDEO:
@@ -973,7 +973,7 @@ option_presets()
                if( max_h != bd_height ) use_resize_tracks = 1;
        }
        for( Track *trk=tracks->first; trk && !use_resize_tracks; trk=trk->next ) {
-               if( !trk->record ) continue;
+               if( !trk->is_armed() ) continue;
                switch( trk->data_type ) {
                case TRACK_VIDEO:
                        if( trk->track_w != max_w ) use_resize_tracks = 1;