View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 130 posts ] 
Go to page Previous  1, 2, 3, 4, 5 ... 9  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject:
PostPosted: Fri May 27, 2005 7:11 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
OK. I have uploaded version 0.4 to the wiki. It will now delete the original for PVR transcodes (unless there is a delete-after mark in the first 25 frames - i.e. same behaviour as DBV to allow you to keep the original recording if you wish). I have corrected the end time calculation that cdmskyler was talking about, but I have assumed a framerate of 25 (PAL), so the end time may be a little later than it should be for NTSC (framerate 30). I don't think the end time matters anyway, but it's nice if it gives an indication of the duration of the recording, and it should be accurate for PAL countries now.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 30, 2005 3:08 am 
Offline
Joined: Fri Jan 23, 2004 1:50 pm
Posts: 6
Hallo Greg,

I have testet the v0.4 and it works ok now :) . The Time is correct and remove of the old show works (works too with the "delete-after" mark).
Eventually you should post in the myth dev list, so more people would test this. There is also a thread, where people search for how to cut commercials without transcode. I also test to burn a dvd from the new cutted shows.
At the moment it fails with the mythburn scripts.
With multiplex setting in the remplex script mythburn scripts can not work with the audio stream (wrong audio stream) and it fail. The cutted show has audio only in some cutted parts. Replex works ok with the cutted stream, i can watch the show with zoomplayer and it works, but it can not burn the dvd. I will test more later, because im busy now.

Thanks for your great work :)

sorry for my bad english :wink:

CdMSkyler


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 30, 2005 4:34 am 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Back when I used the mythtvburn scripts, I had the best luck using myth-mplex instead of mplex or replex. I am trying to get things working using nuv2disc now since that seems to be the preferred way to do it with knoppmyth, but there have been a few probelms with the DVB format files. Jams is helping me work it out.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 7:28 pm 
Offline
Joined: Sun May 15, 2005 8:47 am
Posts: 54
Greg Frost wrote:
Back when I used the mythtvburn scripts, I had the best luck using myth-mplex instead of mplex or replex. I am trying to get things working using nuv2disc now since that seems to be the preferred way to do it with knoppmyth, but there have been a few probelms with the DVB format files. Jams is helping me work it out.


Greg,

Hi !

getting the follow error messages with version 0.4

Result with 26 fields
Expected 25 fields in recorded got 26

a .tmp file is left in the directory.

mythbackend version: 0.18.20050409-1 www.mythtv.org
Please let me know what information you want from the database.

Thanks
Mudit


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 7:56 pm 
Offline
Joined: Sun May 15, 2005 8:47 am
Posts: 54
I modified the fields to 26. Now I'm getting other error messages.

SELECT * FROM recorded WHERE chanid = 1037 AND starttime = '20050620220100'
new start time Mon Jun 20 22:01:00 2005
Error entering recordedmarkup into database!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 8:40 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Are you running CVS? perhaps the format of the recordedmarkup table has changed. commerical_cut-0.4 works fine with 0.18.1 (R5A15.1)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 8:48 pm 
Offline
Joined: Sun May 15, 2005 8:47 am
Posts: 54
Greg Frost wrote:
Are you running CVS? perhaps the format of the recordedmarkup table has changed. commerical_cut-0.4 works fine with 0.18.1 (R5A15.1)


I may have loaded cvs once but now i'm running the 0.18 build. Do you think running cvs version mucked around with the database (upgraded the schema's etc) ?

I think the problems are with insert somehow. When I did a select on the chanid and the time, I already saw entries in there (from prior commercial cut ?). I'll add replace into option (which inserts and replaces too).

Thanks
Mudit


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 10:01 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
Upgrading to cvs and then reverting can definately mess with the database. Unfortunately I don't know enough about querys to write querys that are tolerant to database changes.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 24, 2005 9:40 pm 
Offline
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location: Adelaide, Australia
A few people have shown interest in commercial_cut, so in the interest of open-ness, to let eveyone know what is happening I will post some of the private messages here:
nigelpearson wrote:
Hi Greg. Finally got around to testing this thoroughly.

(actually, I had to grab a .vob file from a DVD I burnt
a few months ago, insert that file into /myth/tv using
myth.rebuilddatabase.pl, build a seek table for it
using mythcommflag --rebuild, and use v4 to cut it,
because it had markups of type 6 instead of 9)


The program had a minor problems.
Here are the changes I made to:

1) make it cope with any number of extra fields in
the recorded table (like for CVS updated DBs),

2) cope with a null recordid,

3) let it keep the original recording, when run from
the command line, without cutpoint trickery

% diff -u commercial_cut.c.orig commercial_cut.c
--- commercial_cut.c.orig 2005-05-27 22:30:14.000000000 +0000
+++ commercial_cut.c 2005-06-13 20:30:38.000000000 +0000
@@ -114,8 +114,9 @@
char *title = NULL;
char *subtitle = NULL;
char *description = NULL;
- int delete_original = 0;
+ int delete_original = 1;
int experimental_pvr_x50_mode = 0;
+ int num_fields;

MYSQL mysql;
MYSQL_RES *res;
@@ -180,6 +181,11 @@
printf ("Ignoring -d (not really sure what it does).\n");
break;

+ case 'k':
+ printf ("Keeping the original recording.\n");
+ delete_original = 0;
+ break;
+
case 'l':
printf ("Using cutlist (which will be used regardless).\n");
break;
@@ -195,8 +201,9 @@
"Usage:\n"
"\n"
"./commercial_cut [-T "Title"] [-S "Subtitle"] [-D "Description"]\n"
- " [-c chanid -s starttime] [input.nuv]\n"
+ " [-c chanid -s starttime] [-k] [input.nuv]\n"
"\n"
+ "-k means keep the original file.\n"
"You must either pass a file that is a valid myth recording that can\n"
"be found in the mythconverg database, or a chanid and starttime of\n"
"such a recording (this is the format supplied to mythtranscode).\n");
@@ -449,19 +456,18 @@
/* If there is at least one cut, and the first cut is non-zero and */
/* less than 25 (i.e a delete after right near the start of the */
/* recording) then keep the original recording. */
-
+
if ((num_cuts > 0) && (cut_start[0] > 0) && (cut_start[0] < 25))
{
delete_original = 0;
cut_start[0] = 0;
- fprintf (output, "Will keep the original recording\n");
- }
- else
- {
- delete_original = 1;
- fprintf (output, "Will delete the original recording\n");
}

+ if (delete_original)
+ fprintf (output, "Will delete the original recording\n");
+ else
+ fprintf (output, "Will keep the original recording\n");
+
for (int cut = 0; cut < num_cuts; cut++)
{
fprintf (output, "Cutlist %d: %d - %d\n",
@@ -865,14 +871,14 @@
}
else
{
- fprintf (output, "Result with %d fields\n", mysql_field_count (&mysql));
+ num_fields = mysql_field_count (&mysql);
+ fprintf (output, "Result with %d fields\n", num_fields);
}

- if (mysql_field_count (&mysql) != 25)
+ if (num_fields != 25)
{
- fprintf (output, "Expected 25 fields in recorded got %d\n",
- mysql_field_count (&mysql));
- exit (1);
+ fprintf (output, "Expected 25 fields in recorded got %d\n", num_fields);
+ fprintf (output, "Database is newer than expected. Resultant file may cause problems.\n");
}

row = mysql_fetch_row (res);
@@ -900,21 +906,44 @@
mysql_real_escape_string (
&mysql, escaped_description, description, strlen (description));

- sprintf (buffer, "INSERT INTO recorded VALUES "
- "(%s,'%s','%s','%s','%s','%s','%s','%s',NULL,%s,'',%s,%s,"
- "'%s',%d,'%s','%s',%s,%lld,%s,%s,'%s','%s','%s','%s')",
- row[0],
- time_t_to_date_string (new_start_time_t),
- time_t_to_date_string (new_end_time_t),
- escaped_title,
- escaped_subtitle,
- escaped_description,
- row[6], row[7], row[9],row[11],row[12],row[13],atoi(row[14]) + 1,
- row[15],row[16],row[17],output_file_size,row[19],
- row[20],row[21],row[22],row[23],row[24]);
+ sprintf (buffer, "INSERT INTO recorded VALUES (%s,'%s','%s','%s','%s','%s',",
+ row[0],
+ time_t_to_date_string (new_start_time_t),
+ time_t_to_date_string (new_end_time_t),
+ escaped_title,
+ escaped_subtitle,
+ escaped_description);
+
+ sprintf (buffer+strlen(buffer), "'%s','%s',NULL,%s,'',%s,%s,'%s',",
+ row[6], // category
+ row[7], // hostname
+ row[9], // editing
+ row[11], // autoexpire
+ row[12], // commflagged
+ row[13]); // recgroup
+
+ if (!row[14])
+ row[14] = "0";
+
+ sprintf (buffer+strlen(buffer), "%d,'%s','%s',%s,%lld,%s,%s",
+ atoi(row[14]) + 1, // recordid
+ row[15], // seriesid
+ row[16], // programid
+ row[17], // lastmodified
+ output_file_size,
+ row[19], // stars
+ row[20]); // previouslyshown
+
+ for (int field = 21; field < num_fields; ++field)
+ {
+//fprintf(output,"Adding field %d - %s\n", field, row[field]);
+ sprintf (buffer+strlen(buffer), ",'%s'", row[field]);
+ }
+
+ strcat(buffer+strlen(buffer), ")");

}
-
+
mysql_free_result (res);

printf ("%s\n", buffer);
%

Also:

1) v0.4 changes the start time of the original file
(subtracts a minute), where 0.1 didn't. This is a pain if I
am extracting several clips from the original file,
because I have to change the file name each time I run
the program. Any reason why this has to happen?

2) For the way I use it (cutting multiple clips from a file),
it would be handy if the script prompted for a new Title,
Subtitle or Description of the new file.
Do you reckon other people would find this useful?
Should that be farmed off to a different script?
(e.g. make cutlib.c, cut.c and cut-and-copy.c)


Greg Frost wrote:
Good stuff Nigel. I will have a close look at your changes soon and try to put them up as 0.5. They seem reasonable at first glance to me.

nigelpearson wrote:

1) v0.4 changes the start time of the original file
(subtracts a minute), where 0.1 didn't. This is a pain if I
am extracting several clips from the original file,
because I have to change the file name each time I run
the program. Any reason why this has to happen?


The reason I do this is because when I run it from the myth interface as a substitute for transcode, it is actually the backend that removes the original recording and renames the .tmp file after mythtranscode completes. I though I could get around this by renaming the original to its .tmp name so that the backend would put the same recording back, and this worked but for some reason, the backend blows away the recordedmarkup info. I couldnt work out how the new recordedmarkup info for the cut recording actually got into the database. So as a quick hack, I renamed the original with a new starttime and updated its info in the database for the new start time so that the backend did not stuff it up.

nigelpearson wrote:

2) For the way I use it (cutting multiple clips from a file),
it would be handy if the script prompted for a new Title,
Subtitle or Description of the new file.
Do you reckon other people would find this useful?
Should that be farmed off to a different script?
(e.g. make cutlib.c, cut.c and cut-and-copy.c)

Not a different script. I think just add a command line switch that makes it prompt for the Title/Subtitle/Description


nigelpearson wrote:
OK. Maybe we could make the script behave differently, depending on whether it is being called as transcode or not?

1) If transcode, default delete_original=1 and change timestamp of original

2) If command-line and -k (delete_original=0), prompt for new title, etc

Greg Frost wrote:
Sounds reasonable.

I guess you just check arg[0] to see if it is called as transcode.

Also if the title/sub/desc are specified on the command line, don't prompt, and when prompting, the default should be the existing title/sub/desc if you just press enter.

Wanna implement and post to the wiki yourself?

nigelpearson wrote:
Yes, in my spare time

Note that the patch I gave you this morning is missing a 'k' in the arg checking.

Note also that a lot of the time the Wiki is not accessible by me
Greg Frost wrote:
Well, I'll give it a go in my spare time too. If your spare time is like mine, chances are very slim that we'll duplicate effort. Shocked

Then just recently:
mwahal wrote:
Greg,

I've modified verion 4 to make it work on 0.18.1 (which has 26 fields).
I'm also in process of specifying an alternate directory for tmp files.

The reason is when commercial cut is running, its reading and writing the files on the same hard drive. The iowait jumps to 90%+ on the system. Any access to the system slows down a lot. I need to experiment by adding another hard drive in the system and use that as tmp directory. So, hopefully, the iowait wont the that high.

Will let you know.

Thanks
Mudit


Sorry Mundit, it would appear that I got the myth/knoppmyth versions a bit confused when I replied to you. It 0.18.1 was actually introduced at R5A16, so I'm not using it yet, and from your comments, it would appear that 0.18 to 0.18.1 changed the recorded table. The patches posted by nigel are a better solution because it should work after they change the recorded table (so long as all they do is add integer fields). Unfortunately neither I, nor (it would appear) nigel, has had time to release a new version.

To make a new version, just change the name of the directory it is in and type make dist. This will create a commercial_cut-newversion.tar.gz in the parent directory (where the version number comes from the directory name).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 26, 2005 3:33 am 
Offline
Joined: Wed Mar 03, 2004 7:43 pm
Posts: 748
Location: Sydney, Australia
Greg Frost wrote:
The patches posted by nigel are a better solution because it should work after they change the recorded table (so long as all they do is add integer fields).


No, I think the extra field code is properly quoted for strings:

Code:
+ sprintf (buffer+strlen(buffer), ",'%s'", row[field]);


Quote:
Unfortunately neither I, nor (it would appear) nigel, has had time to release a new version.


Your wish is my command - I have just uploaded v0.5 to the Wiki![/code]

_________________
| Nigel Pearson, nigel.pearson.au@gmail.com
| "Things you own end up owning you" - Tyler, Fight Club


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 26, 2005 5:29 pm 
Offline
Joined: Sun May 15, 2005 8:47 am
Posts: 54
nigelpearson wrote:
Greg Frost wrote:
The patches posted by nigel are a better solution because it should work after they change the recorded table (so long as all they do is add integer fields).


No, I think the extra field code is properly quoted for strings:

Code:
+ sprintf (buffer+strlen(buffer), ",'%s'", row[field]);


Quote:
Unfortunately neither I, nor (it would appear) nigel, has had time to release a new version.


Your wish is my command - I have just uploaded v0.5 to the Wiki![/code]


Nigel,

Thanks for the 0.5 release !

Your changes will take care of 0.18.1 cvs version database :-) Great !

I'm thinking about addition an option to specify a tmp directory. I've a single drive on my system. And while running a commercial cut, my system goes 95% iowait busy. No access via web or telnet works at that time. Since its doing I/O on the same drive, thats the reason IOWAIT is so high. If I can move the tmp to some other directory, then the IOWAIT can be reduced a lot. When the temp file is written, then it'll be moved to the original. The copying portion will have IOWait in the end, but not as much as in while doing the commercial cut method.

Thanks
Mudit


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 26, 2005 9:02 pm 
Offline
Joined: Wed Mar 03, 2004 7:43 pm
Posts: 748
Location: Sydney, Australia
Mudit, an easier thing to try would be to run commercial_cut at a lower priority (e.g. from the command line do nice 15 commercial_cut ...)

It won't be fast, but it should be a lot kinder to other programs running on the system.

_________________
| Nigel Pearson, nigel.pearson.au@gmail.com
| "Things you own end up owning you" - Tyler, Fight Club


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 26, 2005 11:01 pm 
Offline
Joined: Sun May 15, 2005 8:47 am
Posts: 54
nigelpearson wrote:
Mudit, an easier thing to try would be to run commercial_cut at a lower priority (e.g. from the command line do nice 15 commercial_cut ...)

It won't be fast, but it should be a lot kinder to other programs running on the system.


nigel,

i did try at 19 priority, still the IOWAIT is very high. I dont think Iowait usage depends on process priority. The cpu is idle all the time, its the disk iowait which makes the system very sluggish.

Doing the hdparm test, gives me the following
/dev/hda:
Timing cached reads: 1156 MB in 2.01 seconds = 576.36 MB/sec
Timing buffered disk reads: 82 MB in 3.00 seconds = 27.31 MB/sec

Is that okay MB/sec for a PATA drive ?

Thanks
Mudit


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 26, 2005 11:20 pm 
Offline
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location: Nashville, TN
that's about what I get on my laptop.

_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 27, 2005 8:34 am 
Offline
Joined: Sun May 15, 2005 8:47 am
Posts: 54
Xsecrets wrote:
that's about what I get on my laptop.


I think mine is stuck at udma2. I tried changing via the -x (or whatever option it is), but I cant make it goto udma5. The drive is UDMA5 though (ATA100). May be the chipset driver is not compiled/compatible. I've installed knoppixmyth R5A15.1 and my motherboard is ECS KT600A which I think uses (from the ecs's website)
---------------

VIA® KT600 & VT8237
North Bridge: VIA® KT600
South Bridge: VIA® VT8237
---------------

Do I need to recompile the kernel to get udma5 ?

Thanks
Mudit


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 130 posts ] 
Go to page Previous  1, 2, 3, 4, 5 ... 9  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 5 guests


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu