Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MythTV avi exporter (and file transcoder v0.41-r85)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Sat Jan 06, 2007 1:17 pm    Post subject: MythTV avi exporter (and file transcoder v0.41-r85) Reply with quote

I got bored constantly hacking about nuvexport to make it do what I wanted, so I wrote my own, with a GUI.
It only supports mencoder ATM, with options for the x264 encoder, but it's only the first working copy.
Now has quite a few default profiles to select from, including xvid, dvd and x264

I'd be grateful if you could try and break it so I can bug fix, it's only on the svn server for now.
Any suggestions welcome.

Requires mythtv (mythtranscode), mencoder (mplayer), x264-svn, PyQt and qt-3. Later versions may not require mythtv on the exporting host, but it does for now.
No longer requires mythtv on the export host, but still does for cutlists

Edit:erm, may be confusing, don't run main.py just myth2avi.py.
_________________
Current Project Thread (myth2avi)


Last edited by pteppic on Thu Jul 12, 2007 11:21 pm; edited 9 times in total
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Sun Jan 07, 2007 7:16 pm    Post subject: Reply with quote

feature request in order of preference: :P

1. xvid? my standalone can't deal with x264 at this time, neither can many of friends' AFAIK.
2. optionally update DB with the exported entry as the recording and delete the original recording from disk and DB.
3. search mysql.txt in more standard places before giving up.

one last comment: PyQt adds three more packages to the growing list of packages on my box. But I don't see you going back on this one, because code heavily depends on this.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Mon Jan 08, 2007 1:24 am    Post subject: Reply with quote

1. not a problem, its on the list after a few other tweaks.
Is x264 hungry then? It's the same speed as everything else here (within reason)

2. maybe someday, but I'm not too keen to screw up any databases yet (especially mine :evil: ), but still possible. I'm thinking of caching data in there anyhow, if I can, to speed up the startup time for reading file info, but it would be in it's own table, so a lot safer as long as I don't run drop or anything stupid.

3. can you list some more standard places pls ~/.mythtv/mysql.txt is the only one I know of, sorry

As for PyQT, well you have qt for myth so it's a good start, it provides it's own threading support (which I think I need for multiple windows later) and the mysql libraries. But mainly because it's so quick and simple to use with eric3

It's changed a bit over the last 2 days, it's rev 50 now, and it actually uses the pass logs on the final pass now too(Doh)
I'm gonna put the version and rev in the topic title form time to time, so it's easier to track.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Mon Jan 08, 2007 3:01 am    Post subject: Reply with quote

Some screen shots of rev50.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Mon Jan 08, 2007 3:26 am    Post subject: Reply with quote

pteppic wrote:
1. not a problem, its on the list after a few other tweaks.
Is x264 hungry then? It's the same speed as everything else here (within reason)

2. maybe someday, but I'm not too keen to screw up any databases yet (especially mine :evil: ), but still possible. I'm thinking of caching data in there anyhow, if I can, to speed up the startup time for reading file info, but it would be in it's own table, so a lot safer as long as I don't run drop or anything stupid.

3. can you list some more standard places pls ~/.mythtv/mysql.txt is the only one I know of, sorry

As for PyQT, well you have qt for myth so it's a good start, it provides it's own threading support (which I think I need for multiple windows later) and the mysql libraries. But mainly because it's so quick and simple to use with eric3

It's changed a bit over the last 2 days, it's rev 50 now, and it actually uses the pass logs on the final pass now too(Doh)
I'm gonna put the version and rev in the topic title form time to time, so it's easier to track.
my biggest gripe with mythtv is that the transcoded files are NUV and can't be played on the standalone. nuvexport solves it but leaves the "update DB" out, so either I have huge untranscoded shows under "watch recordings" or I have huge set of nuvexported files which I need the mythvideo to play (and mythvideo is buggy as hell) in mythtv. All this aggravation just because mythtv transcode wants NUV and doesn't give the choice of standard xvid AVI which every standalone divx player can play.

x264 is wonderful but again my standalone can't play it. encoding speed is same as xvid on my machine as well.

nuvexport searches mysql.txt as:
Code:

    my @mysql = ('/usr/local/share/mythtv/mysql.txt',
                 '/usr/share/mythtv/mysql.txt',
                 '/etc/mythtv/mysql.txt',
                 '/usr/local/etc/mythtv/mysql.txt',
                 $ENV{'MYTHCONFDIR'} ? "$ENV{'MYTHCONFDIR'}/mysql.txt" : '',
                 "$ENV{'HOME'}/.mythtv/mysql.txt",
                 'mysql.txt'
                );


pteppic, if you could do xvid and db update thing to point the recording to transcoded one, I will be eternally grateful! I wish I knew mysql (or QT's interface to it) well enough to code it, I would code it myself, I am so desperate for this feature. I am desperate because it gives an integrated view in mythtv under watch recordings, and the recordings work out of box on the standalone player.

one more feature, to make it a complete tool, is to allow everything that works from GUI thru command line as well. This will make it trivial to put it as a user job in mythtv. but this would be the least priority at this time.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Mon Jan 08, 2007 3:52 am    Post subject: Reply with quote

Code:
mysql> select basename from recorded;
+------------------------------------------------------+
| basename                                             |
+------------------------------------------------------+
| America's_Funniest_Home_Videos_2007-01-07_2-00PM.mpg |
+------------------------------------------------------+
1 row in set (0.00 sec)

mysql>
I am just wondering if writing a user job, which does a little mythtranscode, followed by a call to ffmpeg and eventually changes the basename in the DB to point to .avi instead of .mpg, and optionally deletes the .mpg, will stop all the aggravation that I am going thru? will think about this a little more. sorry for the OT.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Mon Jan 08, 2007 5:25 am    Post subject: Reply with quote

darn! more OT.

nuvexport has a '--infile' option which I didn't know about. It just uses the defaults (or those from ~/.nuvexportrc) and encodes a filepath into avi without human intervention. what kind of program doesn't print list of options with --help? nuvexport kind....:-) I always thought it was an interactive program.

Now, only thing left is the database update.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Mon Jan 08, 2007 10:25 am    Post subject: Reply with quote

devsk wrote:
Code:
mysql> select basename from recorded;
+------------------------------------------------------+
| basename                                             |
+------------------------------------------------------+
| America's_Funniest_Home_Videos_2007-01-07_2-00PM.mpg |
+------------------------------------------------------+
1 row in set (0.00 sec)

mysql>


And that works for avi's does it? I mean, the internal player will play avi files?

Any how, xvid is done.
It's odd, xvid via ffmpeg is fast, xvid via mencoder seems slower, but x264 mencoder is faster than either by a long way, especially on pass 1, the files are tiny too (90 minutes at qpal in about 500 meg, and thats with 2ch ac3 384k audio dumped straight from dvd)
x264 is slow on the p4 machine (it's a busy box, pun unintended), but like I say, it flies on amd64
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Mon Jan 08, 2007 10:39 am    Post subject: Reply with quote

devsk wrote:
Now, only thing left is the database update.


Code:
echo "update recorded set basename=\"${infile%.*}.avi\" where basename=\"${infile}\" limit 1;"|mysql -h blah -pblah -u blah mythconverge
?

Then do a delete from recordedmarkup where starttime=(select starttime from recorded where basename=${infile%.*}.avi) and chanid=(select chanid from recorded where basename=${infile%.*}.avi), and mythcomflag --rebuild -i ${infile%.*}.avi to rebuild recorded seek.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Mon Jan 08, 2007 7:41 pm    Post subject: Reply with quote

pteppic wrote:
And that works for avi's does it? I mean, the internal player will play avi files?

After I replaced the original mpg file with the nuvexported xvid AVI and updated the database's basename, it seems to play it fine but because its mapping Up/Down, Left/Right arrows internally, its currently confused with the seeking. its probably because I didn't do the recordedmarkup thing you mentioned.
pteppic wrote:
Any how, xvid is done.

great! that's one down, one to go! Thanks.
pteppic wrote:

It's odd, xvid via ffmpeg is fast, xvid via mencoder seems slower, but x264 mencoder is faster than either by a long way, especially on pass 1, the files are tiny too (90 minutes at qpal in about 500 meg, and thats with 2ch ac3 384k audio dumped straight from dvd)
x264 is slow on the p4 machine (it's a busy box, pun unintended), but like I say, it flies on amd64
x264 is really awesome! Its quality/size ratio is the highest so far but unless I truly have a centralized media PC (or they come out with standalones which decode x264), its restricted to PC only viewing.

And yeah, amd64 rocks with encoding here in 64 bit mode.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Mon Jan 08, 2007 7:52 pm    Post subject: Reply with quote

pteppic wrote:
It's odd, xvid via ffmpeg is fast, xvid via mencoder seems slower, but x264 mencoder is faster than either by a long way
ffmpeg has improved a lot. its not only faster than transcode, it also produced better quality result comparatively. see this post I made to mythtv-users list:

I found ffmpeg to be a winner in all aspects: quality, speed, compatibility and size closer to the specified bitrate. I have uploaded two frame grabs for comparison purposes

http://home.comcast.net/~funtoos/transcode.png
http://home.comcast.net/~funtoos/ffmpeg.png

transcode is a little more smoothed out: note the sharpness in curtain and sunlight falling on the door thru the curtain in ffmpeg on the left side of the grab, whereas they are so fuzzy in transcode. The avg. rate was 1471 for transcode and 1508 for ffmpeg, for a specified rate of 1500. mencoder went crazy with bitrates (used 2800 for a specified rate or 1500), so was ruled out.


It may just be the options that nuvexport passes to these programs, and it is possible that manually I may be able to tune mencoder (my preferred program for x264) better than ffmpeg but for me its necessary to do the database thing, so nuvexport works OOB and is preferred.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Mon Jan 08, 2007 11:25 pm    Post subject: Reply with quote

devsk wrote:
pteppic wrote:
And that works for avi's does it? I mean, the internal player will play avi files?

After I replaced the original mpg file with the nuvexported xvid AVI and updated the database's basename, it seems to play it fine but because its mapping Up/Down, Left/Right arrows internally, its currently confused with the seeking. its probably because I didn't do the recordedmarkup thing you mentioned.


Good, I'm gonna play around with this a bit, and see what can be done to make it seek again (maybe mythcommflag --rebuild??), I don't wanna put out a half baked solution for this.

I'd like to know what encoder you use with nuvexport for xvid (I'd assume ffmpeg), 'cos I want to see if there are any compatability type things going on (like divx{3,4,5} compatible etc)

Xvid via ffmpeg is next on the list after audio settings anyhow, but if I do it before audio I'll just have more to fix after.
It will take some restructuring, as I omitted to remember the "ffmpeg 'in options' infile 'out options' outfile" command format.
An instance of an export profile class per export makes most sense, and is a better programming technique for easy expansion, oh 20:20 hindsight is great :roll: , at least I should be able to do it without total breakage.

I've just done the 'more mysql.txt paths', it will be commit 55.
Just for the record commits 51 thru 53 are kinda broken, well, not kinda, they are all broken, each in their own unique and elusive way.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Tue Jan 09, 2007 1:55 am    Post subject: Reply with quote

pteppic wrote:
I'd like to know what encoder you use with nuvexport for xvid (I'd assume ffmpeg), 'cos I want to see if there are any compatability type things going on (like divx{3,4,5} compatible etc)
ffmpeg produced the most compatible avi for standalone playing. with transcode, I couldn't fast fwd at speeds greater than 2x, audio video went out of sync if I did fast fwd even at 2x, previous/next (forward by 5 minutes I guess) on the remote hung the playback completely. So, I gave up on transcode and stuck with ffmpeg.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Tue Jan 09, 2007 3:01 am    Post subject: Reply with quote

so I did the delete of recordedmarkup and commflag --rebuild, I could seek successfully in the mythtv watch recording but I kept getting
Code:
[mpeg4 @ 0x3151acbf70]warning: first frame is no keyframe
every time I seeked on the window where frontend was started from. I think internal player expects it to be NUV. It plays it fine because NUV is ultimately AVI with some more metadata but it misses some things. no such problems on the standalone player: no problems seeking, no sync problems, no problem fwding or rewinding. I would say I am satisfied with it.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Tue Jan 09, 2007 6:45 am    Post subject: Reply with quote

devsk wrote:
I could seek successfully in the mythtv watch recording but I kept getting
Code:
[mpeg4 @ 0x3151acbf70]warning: first frame is no keyframe


Hmm, may be able to sort that out, perhaps by sticking some keyframes in...
I don't know, but I will experiment when time permits.
Back to top
View user's profile Send private message
devsk
Advocate
Advocate


Joined: 24 Oct 2003
Posts: 3003
Location: Bay Area, CA

PostPosted: Tue Jan 09, 2007 6:54 am    Post subject: Reply with quote

actually, I thought nuvexport already passed ffmpeg the option do exactly that, and this warning was more of something missing in the header which is specific to NUV avi format. But I may be wrong.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Wed Jan 10, 2007 6:38 am    Post subject: Reply with quote

Well, even some of my nicely seeking nuv files spurt out the keyframe error anyway, so no amount of keyframe insertion into avi files stopped it.

I've kinda finished on v0.1, so gave it a version bump, and a lot of internal restructuring, I'm gonna try and work on the delogo filter next, 'cos that really rocks.
Back to top
View user's profile Send private message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Wed Jan 10, 2007 7:58 pm    Post subject: Reply with quote

Hi, this really sounds like a good idea and I'm excited to see it progress. However, I have been having some difficulties running so I would like to post my experiences and hope that they can help improve the utility.

First up is a dialog that says:
Code:
Fatal Error
The file mysql.txt could not be read properly
"LocalHostName" setting not found
Program will now exit

Because of course, I don't use the LocalHostName setting.

I set a name in the mysql.txt and I can run now, but Select Programs is blank, again probably because I don't use LocalHostName.
Code:
QSqlQuery::exec: database not open
QSqlQuery::value: not positioned on a valid record
QSqlQuery::exec: database not open

Then there is a problem even closing the program at this point. When I click on the Exit button I get an error:
Code:
Traceback (most recent call last):
  File "myth2avi.py", line 533, in reject
    if self.thread.running():
AttributeError: 'NoneType' object has no attribute 'running'

I have to open a terminal and kill -9 the python process in order to exit

So at this point, I enable debugging:
Code:
python myth2avi.py -d3

And I remove the LocalHostName query and change the query to:
Code:
q=QSqlQuery( 'select data from settings where value="RecordFilePrefix";')

Then I get another db.open error so I add some debugging:
Code:
if not db.open():
                        print "Error opening database"
                        print db.lastError().driverText()
                        print db.lastError().databaseText()
                        sys.exit(1)

And get
Code:
Access denied for user 'bmerrill'@'192.168.0.3' (using password: YES)

Of course since I am running this as my normal user and not as my mythtv user. It would be nice to be able to specify what user to run with.
So I add
Code:
db.setUserName(self.DBUserName)

And now I begin to get program information.
"Gathering export data for blah blah blah..."
And another error at the end
Code:
Traceback (most recent call last):
  File "myth2avi.py", line 785, in ?
    f = subGUI()
  File "myth2avi.py", line 85, in __init__
    self.item = QCheckListItem(self.item_2,None,QCheckListItem.CheckBox)
TypeError: argument 3 of QCheckListItem() has an invalid type

If I change the None argument to an empty string, i.e. "" then it seems happy. I have to do this once more at line 96 and finally I get the list of my shows.
I select a program that has a cutlist, click the output settings tab, select x264 qpal from the code dropdown and... another error
Code:
Traceback (most recent call last):
  File "myth2avi.py", line 203, in setupOptions
    self.bitrate.setText(None)#self.__tr('0'))
TypeError: argument 1 of QLineEdit.setText() has an invalid type


Selecting Xvid, I can get somewhere, I click Queue Job and off I go. For a few seconds anyway until I get
Code:
Mythtranscode= /usr/bin/mythtranscode -f /tmp/29308 -l -c 1021 -s 20061212185900 -v none
Traceback (most recent call last):
  File "myth2avi.py", line 595, in run
    self.export(obj)
  File "myth2avi.py", line 676, in export
    self.kill()
  File "myth2avi.py", line 762, in kill
    self.base.reap(self.enprocess.pid)
AttributeError: enprocess


And I have not idea at this point. I have never programmed in Python before so I have no idea why it's throwing errors from the GUI. Is there a particular version I should be using? I am using python version 2.4.4 and PyQt version 3.17. Also 90% of my recorded programs are HDTV transport streams. I don't know if this makes any difference to transcode or not. Anyway, I hope this feedback is helpful. I'll keep hacking on it and see if I can get some sort of encoded output out. Please let me know if I can provide any additional information that you might need. Thanks.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Thu Jan 11, 2007 2:20 am    Post subject: Reply with quote

Thanks for the feedback, I'll go through it bit by bit.
Code:
Fatal Error
The file mysql.txt could not be read properly
"LocalHostName" setting not found
Program will now exit
EDIT:FIXED
Right, I'll sort it out to use
Code:
q=QSqlQuery( 'select data from settings where value="RecordFilePrefix";')
if there is no 'LocalHostName' set, and check the dir exists. (EDIT: Hmm, maybe mythtv-setup needs to be run, in which case I won't do anything, but maybe put in an error dialog.)

This
Code:
QSqlQuery::exec: database not open
QSqlQuery::value: not positioned on a valid record
QSqlQuery::exec: database not open
and
Code:
db.setUserName(self.DBUserName)
fall into the doh category
Quote:
db=QSqlDatabase('QMYSQL3',self.DBName)
db.setPassword(self.DBPassword)
db.setDatabaseName(self.DBName)
db.setHostName(self.DBHostName)
db.setPassword(self.DBPassword) << should be db.setUserName(self.DBUserName)
EDIT:FIXED

Code:
Traceback (most recent call last):
  File "myth2avi.py", line 533, in reject
    if self.thread.running():
AttributeError: 'NoneType' object has no attribute 'running'
EDIT:FIXED
That's fixed now.

These two
Code:
Traceback (most recent call last):
  File "myth2avi.py", line 785, in ?
    f = subGUI()
  File "myth2avi.py", line 85, in __init__
    self.item = QCheckListItem(self.item_2,None,QCheckListItem.CheckBox)
TypeError: argument 3 of QCheckListItem() has an invalid type

Code:
Traceback (most recent call last):
  File "myth2avi.py", line 203, in setupOptions
    self.bitrate.setText(None)#self.__tr('0'))
TypeError: argument 1 of QLineEdit.setText() has an invalid type
EDIT:FIXED
are version differences, I'll search through and anytime I've assigned None as a string object set it to self.__tr(''), that should fix that.

Quote:
Selecting Xvid, I can get somewhere, I click Queue Job and off I go. For a few seconds anyway until I get
Code:
Mythtranscode= /usr/bin/mythtranscode -f /tmp/29308 -l -c 1021 -s 20061212185900 -v none
Traceback (most recent call last):
  File "myth2avi.py", line 595, in run
    self.export(obj)
  File "myth2avi.py", line 676, in export
    self.kill()
  File "myth2avi.py", line 762, in kill
    self.base.reap(self.enprocess.pid)
AttributeError: enprocess
EDIT:FIXED
I believe that is mythtranscode exiting without doing much. Because I had sooo much grief with it before I used Popen4, the debug is missing on it, other than spurting out the command.
If you can run
Code:
/usr/bin/mythtranscode -f /tmp/ -l -c 1021 -s 20061212185900
from a terminal and post the output, that will decide if it's a command formulation problem or a mythtranscode problem.

Thanks.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Mon Jan 29, 2007 10:43 pm    Post subject: Reply with quote

Added a few checking routines, and support to export to mpg for DVD (pal and ntsc).
Back to top
View user's profile Send private message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Tue Jan 30, 2007 8:54 am    Post subject: Reply with quote

OK, I had some difficulty getting the gui to come up and had to make some edits to make it work. The biggest problem seemed to be determining the path to the recordings.
This is the error I was getting:
Code:

Traceback (most recent call last):
  File "myth2avi.py", line 886, in ?
    f = subGUI()
  File "myth2avi.py", line 62, in __init__
    self.programs=self.getPrograms()
  File "myth2avi.py", line 277, in getPrograms
    self.getBaseDir()
  File "myth2avi.py", line 264, in getBaseDir
    q=QSqlQuery( 'select data from settings where value="RecordFilePrefix" limit 1;' %self.LocalHostName, db )
TypeError: not all arguments converted during string formatting


And this is the patch I hacked out to make it work:
Code:

--- myth2avi.py   2007-01-30 01:21:51.000000000 -0700
+++ myth2avi.py.edit   2007-01-30 01:22:57.000000000 -0700
@@ -253,18 +253,22 @@
 
    def getBaseDir(self):#get storage dir from mythconverg
       db=QSqlDatabase('QMYSQL3',self.DBName)
+      db.setUserName(self.DBUserName)
       db.setPassword(self.DBPassword)
       db.setDatabaseName(self.DBName)
       db.setHostName(self.DBHostName)
-      db.setPassword(self.DBPassword)
-      db.open()
+      if not db.open():
+         print "Error opening database"
+         print db.lastError().driverText()
+         print db.lastError().databaseText()
+         sys.exit(1)
       if self.LocalHostName:
          q=QSqlQuery( 'select data from settings where hostname="%s" and value="RecordFilePrefix";' %self.LocalHostName, db )
       else:
-         q=QSqlQuery( 'select data from settings where value="RecordFilePrefix" limit 1;' %self.LocalHostName, db )
+         q=QSqlQuery( 'select data from settings where value="RecordFilePrefix" limit 1;' , db)
       q.next()
       self.basename=q.value(0).toString().ascii()
-      db.close()   
+      db.close()
 #enddef
    
    def getDate(self,prog):#for multiple episodes with no titles ok
@@ -299,7 +303,8 @@
          self.index+=1
       db.close()
       for q in range(len(data)):
-         filename='%s%s'%(self.basename,data[q].basename)
+         filename='%s/%s'%(self.basename,data[q].basename)
+         print filename
          if not os.access(filename,os.R_OK):
             data.pop(q)
       if len(data)<1:
@@ -704,7 +709,7 @@
       chanid=str(item.chanid)
       starttime=str(item.starttime).replace('T','').replace('-','').replace(':','')
       dt=float(item.length)
-      mcstring='%s -c %s -s %s -v none'%(mcstring,chanid,starttime)
+      mcstring='%s -c %s -s %s -m -v none'%(mcstring,chanid,starttime)
       passes=item.Epasses
 #do passes
       for pas in range(1,passes+1):


I pretty much suck at python, so I apologize that I could not properly implement some of the fixes. For example, the second edit at line 299, the path stored in mythconverg does not have a trailing backslash so the line should probably be tokenized and one inserted as appropriate, but I have no idea how to do that in Python.

The third edit at line 704 is me messing around. Mythtranscode still refuses to work and I still haven't been able to figure out why. It will just hang forever. Here's the output from the command line:
Code:

/usr/bin/mythtranscode -f /tmp -c 1041 -s 20070130010400 -v important
2007-01-30 01:36:17.564 Using runtime prefix = /usr
2007-01-30 01:36:17.578 New DB connection, total: 1
2007-01-30 01:36:17.583 Enabled verbose msgs: important
2007-01-30 01:36:17.584 New DB connection, total: 2
2007-01-30 01:36:17.596 Using protocol version 31
0: start_time: 1773.839 duration: 11.680
1: start_time: 1773.811 duration: 11.667
stream: start_time: 19709.007 duration: 130.093 bitrate=14411 kb/s
2007-01-30 01:36:17.730 mythtranscode: 0% Completed @ -47.619 fps.


However, if I add the --mpeg2 (-m) option, it appears to complete and writes out the new .tmp file. Maybe mythtranscode doesn't work with HDTV files except with the -m option? I haven't found an answer yet. But either way, it might be nice if QTMyth2avi could support this option as it would export the file with only the cut points removed and mencoder could then handle all of the encoding duties itself.

Anyway, nice job. I think it's really coming along. Let me know if I can help with anything.
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Tue Jan 30, 2007 10:47 am    Post subject: Reply with quote

Thanks for the feedback, and the error was mainly caused by a copy of the 'open the database' bit being copied from a non working version, and my having a DBLocalHostName, so the 'single host' bit went unchecked.

If you do have more than one box using mythbackend on your system, can you post the output of
Code:
echo 'select data from settings where value="RecordFilePrefix"'|mysql -umythtv -pmythtv -h<myth-DB-Host> mythconverg
please...

Code:
+         filename='%s/%s'%(self.basename,data[q].basename)
Has been left the same, but self.basename has a check to make sure the last character is '/' now though, as it's safer than changing each instance it's used.

I can't add -m as a mythtranscode option, as not all input files are going to be mpeg, and all we want it to really do is dump the file to fifos, not really transcode it.

On that subject
Quote:
/usr/bin/mythtranscode -f /tmp -c 1041 -s 20070130010400 -v important
2007-01-30 01:36:17.564 Using runtime prefix = /usr
2007-01-30 01:36:17.578 New DB connection, total: 1
2007-01-30 01:36:17.583 Enabled verbose msgs: important
2007-01-30 01:36:17.584 New DB connection, total: 2
2007-01-30 01:36:17.596 Using protocol version 31
0: start_time: 1773.839 duration: 11.680
1: start_time: 1773.811 duration: 11.667
stream: start_time: 19709.007 duration: 130.093 bitrate=14411 kb/s
2007-01-30 01:36:17.730 mythtranscode: 0% Completed @ -47.619 fps.


That is as far as it will get unless you open another terminal and run the mencoder line too, then they should then both work together.
Back to top
View user's profile Send private message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Tue Jan 30, 2007 5:00 pm    Post subject: Reply with quote

pteppic wrote:

If you do have more than one box using mythbackend on your system, can you post the output of
Code:
echo 'select data from settings where value="RecordFilePrefix"'|mysql -umythtv -pmythtv -h<myth-DB-Host> mythconverg
please...


OK, I have two mythbackends.
Code:
$ echo 'select data from settings where value="RecordFilePrefix"'|mysql -umythtv -pmythtv -h192.168.0.2 mythconverg
data
/myth/hdtv
/myth/record


pteppic wrote:
That is as far as it will get unless you open another terminal and run the mencoder line too, then they should then both work together.

Ah, I see. Something was going wrong and the progress bar would just jump to 100% and no error would be printed and no encoded file written so I was running it on the command line trying to understand what was going on. So I suppose that wasn't it. Probably something dumb I was doing trying to hack around in the code. But either way with the latest version it seems to be working fine and I finally got my first x264 encoded file out! I'm now trying some of the other encoding options like the NTSC dvd support and so forth. Will post back if I spot anything. Thanks for your help. :)
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Tue Jan 30, 2007 7:04 pm    Post subject: Reply with quote

immudium wrote:
OK, I have two mythbackends.
Code:
$ echo 'select data from settings where value="RecordFilePrefix"'|mysql -umythtv -pmythtv -h192.168.0.2 mythconverg
data
/myth/hdtv
/myth/record

That is what I was afraid of, sorry to be a pain, but can you please do
Code:
echo 'select * from settings where value="RecordFilePrefix"'|mysql -umythtv -pmythtv -h192.168.0.2 mythconverg
I need to try and get which value is for which machine without using DBLocalHostName from mysql.txt, Thanks.

immudium wrote:
I'm now trying some of the other encoding options like the NTSC dvd support and so forth.

I know the PAL profile works because I tested it, but don't have the hardware to test NTSC so would be grateful if you could.
Back to top
View user's profile Send private message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Wed Jan 31, 2007 5:28 am    Post subject: Reply with quote

pteppic wrote:

That is what I was afraid of, sorry to be a pain, but can you please do
Code:
echo 'select * from settings where value="RecordFilePrefix"'|mysql -umythtv -pmythtv -h192.168.0.2 mythconverg
I need to try and get which value is for which machine without using DBLocalHostName from mysql.txt, Thanks.


No problem. Glad to help.
Code:
$ echo 'select * from settings where value="RecordFilePrefix"'|mysql -umythtv -pmythtv -h192.168.0.2 mythconvergkk
value   data    hostname
RecordFilePrefix        /myth/hdtv      pegasus
RecordFilePrefix        /myth/record    stargate


I hope that helps. Anything at all, let me know.
pteppic wrote:

immudium wrote:
I'm now trying some of the other encoding options like the NTSC dvd support and so forth.

I know the PAL profile works because I tested it, but don't have the hardware to test NTSC so would be grateful if you could.


I did a quick test with the NTSC DVD profile and the video came out kind of funky looking with the colors all messed up and shifting around. I'll do some more testing and see if I can figure out what's wrong. Everything else looks good for me though.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum