PDA

View Full Version : share .tmf with series 3.



lgkahn
04-19-2008, 04:46 PM
ok I have tried both pytivo and tivo.net and tivo desktop

there does not seem to be an automated solution to share all the .tmf files I have on my pc media server that I used to share via tivo server with the new series 3 boxes.. .that is without going through and converting each and every one to .mpg anyone have any suggestions I would appreciate it.. thanks..

anyone working on enhancing tivoserver with the new mrv standard????

Jamie
04-19-2008, 05:05 PM
They have to be converted. Series3s (including the TiVoHD) store video in a different format than the S2, essentially MPEG transport streams with some additional trickplay data. The S3s can't play the S2 streams without a conversion step.

This is why S2 <=> S3 MRV transfers are considered "non native" and are slower than normal native transfers.

tytotivo (http://www.dealdatabase.com/forum/showthread.php?t=58426&highlight=tytotivo) is your best bet. I see you've visited that thread recently.

lgkahn
04-19-2008, 05:52 PM
weird because I read about people sending .tmf files directly to series 3 that they pulled of series 2's and they played ok.. maybe the tivo itself handles the conversion???

jt1134
04-19-2008, 06:39 PM
weird because I read about people sending .tmf files directly to series 3 that they pulled of series 2's and they played ok..

link please? as jamie said, S2 tmf/ty files are not in the same format as the S3. MRV between units will do the conversion on-the-fly, or you have to do the conversion on your pc via TD, tytotivo, etc.

Jamie
04-19-2008, 07:13 PM
tmf''s extracted from an s3 can be reinserted on an s3; tmf's extracted from an s2 can be inserted on an s2. ty stream format conversion is required to move streams between the two platforms.

I'm sure a tool could be developed to convert an s2 tmf into an s3 tmf, but there are other ways to accomplish the same goal (e.g. tytotivo), so I'm not sure anyone is motivated to do it. bcc is the expert. If anyone could/would do it, it would likely be him.

lgkahn
04-21-2008, 09:14 AM
in place conversion of s2 tmf to s3 would be great I would even pay someone to do it as I have over 400 that I need to convert and not loose info etc.. the ty tivo route will work but looks like it will be labor intensive thanks

I belive tmf2ty will covnert to .ty then tytompg will convert to mpg.. then there is something out there to extrtact the .xml from the .tmf and convert to a .tivo as you can see many steps.. in place .tmf to .tmf would definately be a lot easier.

Jamie
04-21-2008, 09:22 AM
in place conversion of s2 tmf to s3 would be great I would even pay someone to do it as I have over 400 that I need to convert and not loose info etc.. the ty tivo route will work but looks like it will be labor intensive thanks

I belive tmf2ty will covnert to .ty then tytompg will convert to mpg.. then there is something out there to extrtact the .xml from the .tmf and convert to a .tivo as you can see many steps.. in place .tmf to .tmf would definately be a lot easier.From the description, it sounds to me like tytotivo can read S2 tmf files. So it's a one step conversion to go from ty to .tivo. With a little python coding skills, you might be able to build it into pyTiVo so you don't have to do it manually.

jkozee
04-21-2008, 11:11 AM
Yes, tytotivo will convert in a single step. It will take a Series 2 or 3 ty/ty+/tmf file as input and output a .tivo file in a single step. The .tivo file can then be served back to a Series 2 or 3 unit using TivoDesktop or pyTivo. As Jamie mentions, you could call it from pyTivo, or write a script to convert them in a batch.

You invoke tytotivo as:
tytotivo -m <Meida Access Key> -i input.tmf -o output.tivo

Make sure you read the setup information, as it requires the latest tytompg from BCC to convert the tmfs.

bcc
04-21-2008, 03:02 PM
Oh my ears are burning. :)

Yes, tytotivo sounds like exactly what Igkahn is looking for given his requirement for it to be easy and preserve the xml.

The tmf2ty suggestion is off track as tytompg handles tmf directly.

lgkahn
04-21-2008, 10:36 PM
not crazy about going .tivo and the ty2tivo solution as I dont want to keep both .tmf and .tivo files on the server ... too much space.. once the .tmf are gone now I am tied to the media key of my tivos and later if that changes I am screwed


here is a little batch file I found and modified that goes to .mpg instead of .tivo and also generates the associated .xml which seems a little better if not more cumbersome solution to me


tmfconv.bat

also ty2mpg does handle .tmf files directly but not CORRECTLY (at least in my tests) when I ran it on one of my older series 2 tmfs and tried to have pytivo send it to the series 3 it puked... I believe it is not stripping of the .xml or something just skipping over them and including in the mpg or some strange thing...

hence the solution below

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

IF EXIST "%1.mpg" GOTO ENDIT

REM Extract xml and ty files
7z e %1.tmf

REM rename xml file
rename showing.xml %1.xml

REM concat partxx.ty files
rename part00.ty %1.ty
IF EXIST part01.ty copy /Y %1.ty /B + part01.ty /B
IF EXIST part02.ty copy /Y %1.ty /B + part02.ty /B
IF EXIST part03.ty copy /Y %1.ty /B + part03.ty /B
IF EXIST part04.ty copy /Y %1.ty /B + part04.ty /B
IF EXIST part05.ty copy /Y %1.ty /B + part05.ty /B
IF EXIST part06.ty copy /Y %1.ty /B + part06.ty /B
IF EXIST part07.ty copy /Y %1.ty /B + part07.ty /B
IF EXIST part08.ty copy /Y %1.ty /B + part08.ty /B
IF EXIST part09.ty copy /Y %1.ty /B + part09.ty /B
IF EXIST part10.ty copy /Y %1.ty /B + part10.ty /B
IF EXIST part11.ty copy /Y %1.ty /B + part11.ty /B
IF EXIST part12.ty copy /Y %1.ty /B + part12.ty /B
IF EXIST part13.ty copy /Y %1.ty /B + part13.ty /B
IF EXIST part14.ty copy /Y %1.ty /B + part14.ty /B
IF EXIST part15.ty copy /Y %1.ty /B + part15.ty /B
IF EXIST part16.ty copy /Y %1.ty /B + part16.ty /B
IF EXIST part17.ty copy /Y %1.ty /B + part17.ty /B
IF EXIST part18.ty copy /Y %1.ty /B + part18.ty /B
IF EXIST part19.ty copy /Y %1.ty /B + part19.ty /B
IF EXIST part20.ty copy /Y %1.ty /B + part20.ty /B
del /Q part*.ty

REM convert to mpg
tytompg.exe %1.ty
del /Q %1.ty

:ENDIT

C:\utils>


next step is to find .tmf extensions in pytivo and handle the conversion on the fly b4 calling ffmpeg.. shouldnt be all that difficult..

Jamie
04-21-2008, 10:45 PM
Most of that script is unnecessary. tytompg (http://www.dealdatabase.com/forum/showthread.php?t=58397) can handle tmf directly. There should be no need to call ffmpeg at all when transfering these. You use tytompg instead.

Sounds like a fine solution, if you can coerce pytivo to use the xml metadata. I don't think it is currently setup to read that info in xml, but it probably won't be hard to add that.

lgkahn
04-21-2008, 11:29 PM
next attempt on 2nd file tytompg did work for so trying this.. had to write a little c program to get the xml from the original file name
#include <string.h>
#include <stdio.h>

void main (int argc, char **argv)

{

char fname[500];
char result[500];
char *pdest;
char cmdstring[1000];

if (argc <1)
{
fprintf(stderr,"Syntax: makeshowing needs operation input file\n\n");
return;
}

strcpy(fname,argv[1]);
// fprintf(stdout,"the file name is %s \n",fname);

// now look for .tmf in name

pdest = strrchr(fname, '.');

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

// fprintf(stdout," found . at location %d \n",theloc);
strncpy(result,fname,theloc);

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

sprintf(cmdstring,"rename showing.xml \"%s\" \n",result);
fprintf(stdout,"cmd string = %s \n",cmdstring);
system(cmdstring);
}

}


and here is the new batch

@ECHO OFF
REM Extract xml
7z -y e %1 showing.xml

REM rename xml file
makeshowing %1

REM convert to mpg
tytompg.exe -y %1

jkozee
04-22-2008, 12:03 AM
lgkahn,

Glad to see you're working this out for your own solution, but I feel compelled to address some of your rationale.


not crazy about going .tivo and the ty2tivo solution as I dont want to keep both .tmf and .tivo files on the server ... too much space..
Simply delete the orignial tmf. You will have the same issue no matter what you convet to as the original file is no longer needed.


once the .tmf are gone now I am tied to the media key of my tivos and later if that changes I am screwed
MAK keys are tied to your TiVo account, and won't (shouldn't) change as long as your account remains active. Additioanlly, tivodecode can strip the MAK from a .TiVo further. Further, the tytotivo app doesn't really produce an encrypted .tivo file. Basically it creates an encrypted .tivo header file, then attaches an unencrypted .mpg file to it. This allows for faster transfers to the units using pyTivo or TivoDesktop (~25-30% faster IIRC), as no decryption overhead is introduced other than the initial header portion of the file. This also means that you can simply extract out the mpg file from the .tivo file by splitting it after the header file (no decryption needed).

You've said that you want to use pyTivo, since .tivo files are supported, it seems much easier to just supply a single file. Orginally you asked about a s2tmf to s3tmf conversion, which yould make more since if you wanted to use mfs_ftp to upload the files, but you would have to maintain two files (s2 and s3 version) or do on the fly conversion. If you want to do a one time conversion, it seems much easier to put everything into a .tivo format that can be used by multiple server apps and can be transferred directly to s2 (except for HD content) or s3 units. Did I overlook another criteria?

lgkahn
04-22-2008, 02:11 PM
not true you don't haev the issue with .mpgs as they are not encrypted till pytivo or whatever streams them to you tivo and you forget that these files came off of dtv tivos and then would no longer be streameable to them once there are converted to .tivo files but .mpgs would also still be streameable to both

also a .tmf to mpg conversion for pytivo as outlined above lets me keep the files in .tmf format from the series 2 so that I can also re-stream them to the series 2 tivos or dtivos with tivoserver but also stream them to the series 3 with pytivo and only maintain one version of the files.. and say if some new tivo comes out later I don't have to go stripping off all the encryption as they are stored unencrypted as they should be in my opinion

bcc
04-22-2008, 05:26 PM
Still sounds like tytotivo does exactly what you claim to be looking for. Not sure why you're opposed to it. By all means keep your .tmf as your master copies, but those files need to be converted to another format to be usable on any newer tivos.

BTW the .tivo produced by tytotivo can be thought of as just a container format around the output from tytompg. There is no encryption of the .mpg going on. The MAK is only used to apply the qualcomm cipher to the .tivo file's header.

lgkahn
04-23-2008, 09:46 PM
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");
}

mimsborne
11-05-2009, 02:01 PM
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?