Ticket #3533: mythtranscode.diff

File mythtranscode.diff, 2.8 KB (added by maverik044, 17 years ago)
  • programs/mythtranscode/main.cpp

    old new void usage(char *progname)  
    5454    cerr << "\t--fifosync            : Enforce fifo sync\n";
    5555    cerr << "\t--buildindex     or -b: Build a new keyframe index\n";
    5656    cerr << "\t                        (use only if audio and video fifos are read independantly)\n";
     57    cerr << "\t--video filename      : Build a new keyframe index for a video\n";
     58    cerr << "\t                        (non-recording file)\n";
    5759    cerr << "\t--showprogress        : Display status info to the stdout\n";
    5860    cerr << "\t--verbose level  or -v: Use '-v help' for level info\n";
    5961    cerr << "\t--help           or -h: Prints this help statement.\n";
    int main(int argc, char *argv[]) 
    8486    int found_chanid = 0;
    8587    int found_infile = 0;
    8688    int update_index = 1;
     89    int isVideo = 0;
    8790
    8891    for (int argpos = 1; argpos < a.argc(); ++argpos)
    8992    {
    int main(int argc, char *argv[]) 
    137140                return TRANSCODE_EXIT_INVALID_CMDLINE;
    138141            }
    139142        }
     143        else if (!strcmp(a.argv()[argpos],"--video"))
     144        {
     145            if (a.argc() > argpos)
     146            {
     147                infile = a.argv()[argpos + 1];
     148                found_infile = 1;
     149                isVideo = 1;
     150                build_index = true;
     151                mpeg2 = true;
     152                ++argpos;
     153            }
     154            else
     155            {
     156                cerr << "Missing argument to --video option\n";
     157                usage(a.argv()[0]);
     158                return TRANSCODE_EXIT_INVALID_CMDLINE;
     159            }
     160        }
    140161        else if (!strcmp(a.argv()[argpos],"-o") ||
    141162                 !strcmp(a.argv()[argpos],"--outfile"))
    142163        {
    int main(int argc, char *argv[]) 
    362383    }
    363384    if (jobID >= 0 && (found_infile || build_index))
    364385    {
    365          cerr << "Can't specify -j with --buildindex or --infile\n";
     386         cerr << "Can't specify -j with --buildindex, --video or --infile\n";
    366387         return TRANSCODE_EXIT_INVALID_CMDLINE;
    367388    }
    368389    if ((jobID >= 0) && build_index)
    int main(int argc, char *argv[]) 
    403424
    404425        infile = pginfo->GetPlaybackURL(false, true);
    405426    }
    406     else
     427    else if (!isVideo)
    407428    {
    408429        QFileInfo inf(infile);
    409430        pginfo = ProgramInfo::GetProgramFromBasename(inf.fileName());
    int main(int argc, char *argv[]) 
    438459        }       
    439460    }
    440461
     462    if (isVideo)
     463    {
     464        pginfo = new ProgramInfo;
     465        pginfo->isVideo = 1;
     466        pginfo->pathname = infile;
     467    }
     468
    441469    if (infile.left(7) == "myth://") {
    442470        VERBOSE(VB_IMPORTANT, QString("Attempted to transcode %1. "
    443471               "Mythtranscode is currently unable to transcode remote "