Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: share .tmf with series 3.

  1. #16
    Join Date
    Jan 2004
    Location
    n.h. usa
    Posts
    955
    ok a little more progress now at least I am down to converting a directory at a time and have modified the script to convert the .tmf standard .xml to the .txt format that py tivo likes... still would like to link this into pytivo somehow so I dont have to convert.. but started poking around in it and there is a substantial amount of code that goes through the output of ffmeg looking at stuff to get hints about what to do .. have to figure out how to reproduce that since there would be no call to ffmpeg at all in our case..

    ie batch file..

    C:\utils>cat tmfconv.bat
    rem @ECHO OFF

    REM Extract xml and ty files
    7z -y e %1 showing.xml

    REM convert to mpg
    tytompg.exe -y -i %1

    REM rename xml file
    procmetadata %1


    procmetadatasource


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    void main(argc, argv)
    int argc;
    char *argv[];
    {
    FILE *infile = NULL;
    FILE *outfile = NULL;
    int letter;
    char cmdline[5000];
    int debug = 0;
    int linecount =0;
    char fname[500];
    char result[500];
    char *pdest;
    char cmdstring[1000];

    if (argc != 2)
    {
    printf("proctxt (i.e. xml to txt file conversion) 1.0 (c) 2008 by L. Kahn\n");
    printf("-----------------------------------------------------------------\n");
    printf("\nFormat: procmetadata filename\n\n");
    exit(1);
    }

    strcpy(fname,argv[1]);
    // now look for .tmf in name

    pdest = strrchr(fname, '.');

    if (pdest != NULL)
    {
    int theloc;
    theloc = pdest - fname + 1;

    strncpy(result,fname,theloc);

    result[theloc] = '\0';
    strcat(result,"txt");

    }

    if ((infile = fopen("showing.xml","rb+")) == NULL)
    {
    printf("ERROR: couldn't open infile: showing.xml \n",argv[1]);
    exit(1);
    }

    if ((outfile = fopen("temp11.","wb+")) == NULL)
    {
    printf("ERROR: couldn't create temp11. file\n");
    fclose(infile);
    exit(1);
    }

    while (!feof(infile))
    {
    int ll;
    char last;
    int i =0;
    int processingkeyword =0;
    int processingdata =0;
    char line[5000];
    int skipclosing = 0;

    //fprintf(stderr,"in eof loop\n");

    fgets( line, 5000, infile );
    if (debug ==1) fprintf(stderr,"read line %s \n",line);
    ll =strlen(line);
    ++linecount;

    processingkeyword = 0;
    processingdata = 0;
    last = 0;

    // skip first two lines
    // also skip object and subobject lines
    if ((linecount > 2) &&
    (strstr(line,"<Object") == 0) &&
    (strstr(line,"<SubObject") == 0) &&
    (strstr(line,"</Object") == 0) &&
    (strstr(line,"</SubObject") == 0))
    {

    while (i<ll)
    {

    char letter = line[i];
    skipclosing = 0;

    if (debug == 1) fprintf(stderr,"letter: %c\n",letter);

    if (processingkeyword == 0 && last == '<' && letter != '/')
    {
    processingkeyword = 1;
    }

    if (processingkeyword)
    {

    if (letter == '>')
    {
    if (debug == 1) fprintf(stderr,"found end of keyword\n");
    fprintf(outfile," : ");
    processingkeyword = 0;
    processingdata = 1;
    skipclosing = 1;
    }
    }

    if (processingdata)
    {

    if (letter == '<')
    {
    if (debug == 1) fprintf(stderr,"found end of data\n");
    fprintf(outfile,"\n");
    processingdata = 0;
    break;
    }
    }

    if ((processingkeyword || processingdata) && skipclosing != 1)
    {
    fprintf(outfile,"%c",letter);
    }

    last = letter;
    ++i;
    } // end of line loop
    } // end skip first 2 lines

    if (debug == 1) fprintf(stderr,"end of line loop\n");

    } // end of read line loop

    if (debug == 1) fprintf(stderr,"end of proc\n");

    fclose(infile);
    fclose(outfile);

    strcpy(cmdline,"copy temp11. \"");
    strcat(cmdline,result);
    strcat(cmdline,"\"");
    if (debug == 1) fprintf(stderr,"the command line = %s \n",cmdline);
    system(cmdline);
    system("erase temp11.");
    system("erase showing.xml");
    }

  2. #17
    Join Date
    Sep 2009
    Posts
    3

    Thumbs down running tytompg on Mac OS 10.4.11

    Can anyone offer a rather clueless user run tytompg on my Mac? I've downloaded a few versions. I see linux-x86 versions, linux-x86-64, and mac-x96 versions. None of these will start up for me. I have a PPC based mini-mac. Here's typically what I see:
    MPs-Mac-mini:/Users/macuser/Desktop/downloads/tytompg-1/linux-x86 root# ls -al
    total 304
    drwxrwxr-x 5 macuser macuser 170 Nov 5 10:46 .
    drwx------ 10 macuser macuser 340 Oct 25 12:47 ..
    -rw-rw-r-- 1 macuser macuser 6148 Nov 5 10:46 .DS_Store
    lrwxr-xr-x 1 root macuser 56 Nov 5 10:57 TheRescuers.tmf -> /Users/macuser/Documents/Tivo Recordings/TheRescuers.tmf
    -rwxrwxr-x 1 macuser macuser 73304 Jan 28 2008 tstompg
    -rwxrwxr-x 1 macuser macuser 73304 Jan 28 2008 tytompg
    MPs-Mac-mini:/Users/macuser/Desktop/downloads/tytompg-1/linux-x86 root# tytompg -y TheRescuers.tmf
    -sh: tytompg: command not found

    Not sure why it cannot see the executable? "ls" sees it. Suggestions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •