For discussions about development of TAPs, patches and other software for the Toppy

Moderator: Technical

captain747480
Frequent contributor
Posts: 499
Joined: Sat Jun 25, 2005 9:26 am
Location: London Transmitter: Crystal Palace

Post by captain747480 »

The rec2ts.php is in the same directory as the files I'm trying to convert. I've tried a number of individual .rec files and also *.rec but it always gives the 'Failed to Open' message.
TF5800 HD103SI 1Tb HDD, TS On,F/W: MS6 Recommended F/W 12/9/2009 -Sy+Pe
TAPs: MyStuff 6.4; TF5000 Display v1.53; MHEG Control A2f; EPG2MEI v0.96; TAP Commander 1.0.3; MyInfo B5.5; AccurateBM v0.3; SecCache (UK) v0.4; Font Manager 1.0d
Other Kit:LG 37LE5900 TV, Zotac ND-22 HTPC running XMBC, Sky+ HD, Panasonic HT-520 Home Cinema, Harmony 885, Asus WL-500GX with Oleg's, 2Tb NAS (Mirrored), Flirc USB Keyboard Emulator
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

captain747480 wrote:it always gives the 'Failed to Open' message.
Hmm... that's a very basic error, so something is wrong. Do the filenames have spaces in them, maybe? (You can either use backslash to escape them, or wrap the whole filename in quotes -- you can usually use filename completion [tab] to help with this.)

And from the path to php I assume you're running this on an Asus or Slug (or the like). So does rt2mei work for you?
DefineByte
Frequent contributor
Posts: 221
Joined: Thu Jun 07, 2007 10:35 am
Location: UK

Post by DefineByte »

You need to change to the directory the files are in (cd) before that command will work, don't you? Did you do that?

(apologies if I'm stating the obvious, or talking rubbish :oops:)
TF5800 250GB 5.13.65+patches AutoStart: Power Restore 0.7.6, EIT Sub 0.6 SnG, SecCache (UK) 0.4, Extend 1.7, Info Viewer 1.9 DE, QuickJump 1.72, UK Auto Scheduler 0.73.1, EPGnavigator 6.1b (simonc/biggsd), Filer 2.21, TF5000Display 1.53a Other TAPs: Channel Manager 5.1, CutAds 1.3, FastScanGUI 0.6a, HDDInfo 2.3a, HDFW 2.4, JoinAds 1.3, Signal Monitor 0.53, SimpleCharEditor 3.09, Sudoku 1.5, TAP Commander 1.34, Testpatterns 1.2
captain747480
Frequent contributor
Posts: 499
Joined: Sat Jun 25, 2005 9:26 am
Location: London Transmitter: Crystal Palace

Post by captain747480 »

R2-D2 wrote:
captain747480 wrote:it always gives the 'Failed to Open' message.
Hmm... that's a very basic error, so something is wrong. Do the filenames have spaces in them, maybe? (You can either use backslash to escape them, or wrap the whole filename in quotes -- you can usually use filename completion [tab] to help with this.)

And from the path to php I assume you're running this on an Asus or Slug (or the like). So does rt2mei work for you?
@DefineByte - I've tried running this from the directory where the files I want to convert are stored and using full path names as well as the shortened version I posted.

@R2-D2 - Yes some of the files have spaces but I've edited one of them so it doesn't and I still get the 'Failed to Open'. I had also disabled my Swap File and thought that might be causing problems but I've re-enabled my Swap File and I still get the error.

I am using this on an Asus as you surmised and rt2mei works.

Unfortunately I've not got much time to play about but hopefully at the weekend I'll be able to look at your script and try to de-bug it myself. Thanks for your help so far I'll post back once I've dug about a bit more.
TF5800 HD103SI 1Tb HDD, TS On,F/W: MS6 Recommended F/W 12/9/2009 -Sy+Pe
TAPs: MyStuff 6.4; TF5000 Display v1.53; MHEG Control A2f; EPG2MEI v0.96; TAP Commander 1.0.3; MyInfo B5.5; AccurateBM v0.3; SecCache (UK) v0.4; Font Manager 1.0d
Other Kit:LG 37LE5900 TV, Zotac ND-22 HTPC running XMBC, Sky+ HD, Panasonic HT-520 Home Cinema, Harmony 885, Asus WL-500GX with Oleg's, 2Tb NAS (Mirrored), Flirc USB Keyboard Emulator
richie
Frequent contributor
Posts: 156
Joined: Wed Mar 30, 2005 1:05 pm
Location: Ash Vale (Hannington)

Post by richie »

Is the file greater than 2GB ?

If so you may need a hacky perl script I developed ....
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

richie wrote:Is the file greater than 2GB ?
Ah yes, you probably need a PHP that understands how to open big files (5.2?).
richie
Frequent contributor
Posts: 156
Joined: Wed Mar 30, 2005 1:05 pm
Location: Ash Vale (Hannington)

Post by richie »

I have php 5.2.5 and found I still needed my script to open large files.
richie
Frequent contributor
Posts: 156
Joined: Wed Mar 30, 2005 1:05 pm
Location: Ash Vale (Hannington)

Post by richie »

perl had the same problem so i think it was OS related. I got round it by dealing with STDIN which meant instead of changing bytes on-the-fly I had to rewrite the entire file then delete the original. A bit slower, but an acceptable workaround (but then I have a 160Gb disk attached rather tahn a little memory stick).
captain747480
Frequent contributor
Posts: 499
Joined: Sat Jun 25, 2005 9:26 am
Location: London Transmitter: Crystal Palace

Post by captain747480 »

Ok, it's definitely the 2GB problem I've managed to run the PHP Script Ok on files below 2GB but it fails with the 'Failed to Open' message if they're over 2GB.

I'm running with PHP 5.2.4.
TF5800 HD103SI 1Tb HDD, TS On,F/W: MS6 Recommended F/W 12/9/2009 -Sy+Pe
TAPs: MyStuff 6.4; TF5000 Display v1.53; MHEG Control A2f; EPG2MEI v0.96; TAP Commander 1.0.3; MyInfo B5.5; AccurateBM v0.3; SecCache (UK) v0.4; Font Manager 1.0d
Other Kit:LG 37LE5900 TV, Zotac ND-22 HTPC running XMBC, Sky+ HD, Panasonic HT-520 Home Cinema, Harmony 885, Asus WL-500GX with Oleg's, 2Tb NAS (Mirrored), Flirc USB Keyboard Emulator
richie
Frequent contributor
Posts: 156
Joined: Wed Mar 30, 2005 1:05 pm
Location: Ash Vale (Hannington)

Post by richie »

Don't know if you're proficient at editing php but in perl the trick was
1. Don't try to modify the file in-place - with >2GB, better to output to a new file. Slower, but it works.
2. Don't open a filename, but instead use STDIN and STDOUT
This involves changing the input and output file handles within the php script to STDIN and STDOUT, and then something like ...
cat FILENAME.rec | rec2ts.php > FILENAME.ts

I had a look to see if I could release even snippets of my stuff, but it's all a mess at the mo ...
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

richie wrote:1. Don't try to modify the file in-place - with >2GB, better to output to a new file. Slower, but it works.
Then it would be a "complicated and slow .REC conversion". :) And bdb has a rec2ts that does that (and I think it's a fairly portable C program).
richie
Frequent contributor
Posts: 156
Joined: Wed Mar 30, 2005 1:05 pm
Location: Ash Vale (Hannington)

Post by richie »

Except it doesn't work on the asus for file sizes greater than 2GB. Which is why I use my method for such files!

Would love to hear of an alternative method which does work (a) on the asus (b) for 2gb files and (c) Using inplace editing!

Have just re-read a bit more carefully. If the C progam does that then that would be great ... but as the PHP and Perl both failed in a similar way, even using an up-to-date PHP, I've feared it is an underlying OS restriction for such languages ...
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

richie wrote:Except it doesn't work on the asus for file sizes greater than 2GB.
Have you compiled it for the Asus?
richie
Frequent contributor
Posts: 156
Joined: Wed Mar 30, 2005 1:05 pm
Location: Ash Vale (Hannington)

Post by richie »

Yes. It doesn't work - more andd more it looks like an underlyng OS limitation in the way C, PHP and perl use it. The same restriction does not seem to apply to other applications such as mencoder generating large files on the fly.

But in any case, rec2ts.c doesn't modify files in place, so is just as "complicated and slow" as my method! But at least mine works :lol:
R2-D2
Frequent contributor
Posts: 12148
Joined: Mon Dec 18, 2006 11:15 am
Contact:

Post by R2-D2 »

richie wrote:But in any case, rec2ts.c doesn't modify files in place
I thought I'd clearly mentioned that it didn't. :? You're probably right about a basic limitation in the C library used on the Asus, which I suppose is not completely unreasonable (although a little short-sighted). So the previous suggestion of a TAP that does the job starts to make a little more sense.
Post Reply