Author |
Message |
stdim
|
Posted: Thu Apr 28, 2005 12:21 am |
|
Joined: Thu Aug 05, 2004 1:57 am
Posts: 9
|
Hello,
I have installed R5A12 using a PVR350...
I just found an interesting program in knoppmythwiki claiming to cut commercials after editing....
[url]http://knoppmythwiki.homelinux.org/index.php?page=links/CrudeMPEG2cutForDVB
My problem is that I cannot download it....
....even if I go to (Attachments) links...
The name is : commercial_cut-0.1.tar.gz
I whould appreciate some hints from anybody....
Thanks in advance,
and ...
...happy Easter to everybody
[/url]
|
|
Top |
|
 |
Greg Frost
|
Posted: Thu Apr 28, 2005 1:27 am |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
I wrote it. I do not know what happened to the attachments on the wiki. I can tell you that it will not work with R5A12 because the format of the tables that it plays with in the database have changed. Nigels patch for the database change from Mythtv 0.15 to 0.16 has disappeared too. I am planning on writing a version for the latest R5 alpha that replaces mythtranscode so that you can just press x in the myth interface to get it to cut out the marked commercials, but I'm still sorting out a few issues with my R5A15 install. I have uploaded the commercial_cut tar file so it is available on the wiki again FWIW.
|
|
Top |
|
 |
Xsecrets
|
Posted: Thu Apr 28, 2005 9:02 pm |
|
Joined: Mon Oct 06, 2003 10:38 am
Posts: 4978
Location:
Nashville, TN
|
yeah sorry some of the attachments from the wiki got lost a while back.
_________________ Have a question search the forum and have a look at the KnoppMythWiki.
Xsecrets
|
|
Top |
|
 |
Greg Frost
|
Posted: Wed May 18, 2005 7:12 am |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
For those of you that have used my commercial cutter http://www.knoppmythwiki.org/index.php?page=CrudeMPEG2cutForDVB (red321 and nigelpearson that I know of) I have posted a new version of the cutter on the wiki.
This new version is suitable for use with R5A15.1 and replaces mythtranscode. You can install it by untaring the sources and typing make install. You can uninstall it, and it will put the original mythtranscode back by typing make uninstall.
It does the mpeg2 cutting as described on the wiki. It will normally replace the recording with the new cut recording, but if you put a delete after mark on one of the first 24 frames (but not the first frame) it will create a new cut recording and leave the original recording in tact (But for complicated reasons I will not go into here, the timestamp on the original recording will be one minute earlier than it used to be).
I have been meaning to get around to doing this for ages. Now I just need to work out how to burn these commercial free recordings to DVD.
Last edited by Greg Frost on Fri May 20, 2005 4:08 am, edited 1 time in total.
|
|
Top |
|
 |
red321
|
Posted: Fri May 20, 2005 2:00 am |
|
Joined: Sun Mar 07, 2004 5:34 am
Posts: 116
Location:
UK
|
Tryed this and couldnt work out why it wasnt working, eventually found out why  I am running on cvs, with everything linked to /usr/local instead of /usr
Once I fixed my obvious mistake, it works perfectly, does exactly what i wanted, quick comercial cutting without re-encoding, all integrated with myth. Reccomend it to all ! Those guys on dev-mythtv don't know what they are missing.
Terrific ! 
|
|
Top |
|
 |
Greg Frost
|
Posted: Fri May 20, 2005 4:14 am |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
Thanks for your kind words red321. I thought you would like it. Sorry it was so long in coming.
By the way, you know that you can change settings.pro and edit the "PREFIX = /usr/local" to be "PREFIX = /usr" and then when you build and install myth, it will install over the top of the standard knoppmyth install so that there is no confusion. (Thats how I did it back in R4V5 when myth needed to be re-copmpiled for DVB support. It may be different now.)
|
|
Top |
|
 |
stdim
|
Posted: Tue May 24, 2005 2:16 am |
|
Joined: Thu Aug 05, 2004 1:57 am
Posts: 9
|
Hello Greg Frost ,
I have ( as said before) installed R5A12 and using a PVR350
I tried installing this greate piece of software : commercial_cut-0.2.tar.gz
...but seams does not work with PVR350 ( but it must be it is my mistake ....)
1) ... is it worth trying it under R5A12 or should I upgrate to R5A15.1 ?.....
2) ....if I could try it ....
....I noticed that creates an output file of 0 (zero) size
2a) if I am not mistaken the problem starts when searches recordedmarkup table for rows of my recording of type=9 ( but I only have type=6 rows...)
2b) If you need some debuging from me....let me know
Thanks in advance...
|
|
Top |
|
 |
Greg Frost
|
Posted: Tue May 24, 2005 3:25 am |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
Sorry stdim, "great piece of software" it certainly is not. I hacked it by looking at the information in my database and working out what it meant with my DVB recordings. I guess that when myth records with the ivtv drivers, the recordedmarkup table has different information?? If this is the case, it's simply not going to work as it stands. It uses the type=9 info to work out the byte offset of various frames corresponding to the cutpoints in the recording.
We could go through the same exercise with your recordings, and see if we can work out how to do the cuts. Could you post a snippet of your recordedmarkup table for one of your recordings? If the type=6 stuff is similar I might be able to get it to work.
Also what timezone do you live in? It might be easier to hook up in #knoppmyth and see if we can work it out. I'm in South Australia +9:30.
I still don't know if I can burn the cut recordings to DVD successfully (although I did manage this back when I was running R4V5 using the mythtvburn scripts). I would like to get nuv2disc working, since this seems to be the knoppmyth sanctioned way of burning DVDs, but it doesnt seem to recognise even my uncut recordings as MPEG 2 (even though mplayer happily does). I hope to work it out possibly with help from jams.
|
|
Top |
|
 |
stdim
|
Posted: Wed May 25, 2005 1:34 am |
|
Joined: Thu Aug 05, 2004 1:57 am
Posts: 9
|
Hello Greg,
I come from Greece ( so it is GMT+2 and PAL country ) ... so quite difference ...
As I am a bit new to this ... I do not know what #knoppmyth is so I will try to reply here....
I am at work at the momment and I took a chance to post reply some info I have...hope it helps. It comes from a recording of mine which has filled the recordedmarkup table marking every ONE offset....with type=6 entries...
1) do you know if there should be some configuration to create type=9 entries or less type=6 entries per recording?.
2) is it correct that there are so many marked type=6 entries?... do you know what "mark" stands for?...
3) I remind you that I have R5A12 release....is it the same?...
4) I have taken a look to your source....and seams to me that the idea should be correct.....
here is some info from the database....
======================================
SQL > select chanid,starttime from recorded where title='test_cut';
chanid starttime
1003 2005-05-20 20:26:00
-------------------------------------------
SQL > select * from recorded where chanid='1003' and starttime='2005-05-20 20:26:00' ;
chanid starttime endtime title subtitle description category hostname bookmark editing cutlist autoexpire commflagged recgroup recordid seriesid programid lastmodified filesize stars previouslyshown originalairdate preserve findid deletepending
1003 2005-05-20 20:26:00 2005-05-20 21:25:00 test_cut 2005/05/20 8:25 PM Fri May 20 - (60min) - Manual recording Manual recording mybox.mydom NULL 0 0 - 36096\n71714 - 79508\n81111 - 89268\n 0 0 Default 158 20050521191515 2236123018 0 0 0000-00-00 0 0 0
--------------------------------------------
SQL > select cutlist from recorded where title='test_cut';
cutlist
0 - 36096\n71714 - 79508\n81111 - 89268\n
--------------------------------------------
SQL > select mark,offset,type from recordedmarkup where chanid='1003' and starttime=
'2005-05-20 20:26:00';
mark offset type
0 NULL -3
0 38 6
1 229018 6
2 480266 6
3 740382 6
4 983526 6
5 1228630 6
6 1485934 6
7 1739142 6
8 1965770 6
9 2315278 6
10 2613542 6
.
.
. mark records every one... (that is 7438 records for one hour recording.....)
.
.
7430 2233092962 6
7431 2233454758 6
7432 2233819190 6
7433 2234189222 6
7434 2234557794 6
7435 2234903162 6
7436 2235201514 6
7437 2235503874 6
7438 2235810418 6
7439 2236123018 6
I hope it will help....
hello to beautiful Australia
Thanks again.
|
|
Top |
|
 |
Greg Frost
|
Posted: Wed May 25, 2005 4:10 am |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
That looks interesting. Unfortunately, the type=6 entries do not seem to be frame offset versus byte offset in the file, but all may not be lost.
You did well to post the "recorded" entry, because I can see from the cutlist that the recording has 89268 frames (assuming that you had a cutpoint near the end that was a delete to end of file cut). I also notice that 89268 is exactly 12 times 7439 (the last entry in the recordedmarkup), so it may be safe to assume that the entries in recorded markup are for every 12 frames, and if this is the case, it should be a simple matter to make commercial cut do something similar with PVR recordings to what it does with DVB recordings.
I also notice that the last markup has an offset of 2236123018 which matches the filesize entry in recorded table, so it seems those numbers are byte offsets in the file.
One thing that does disturb me is that the first type=6 entry has an offset of 38 bytes. This is not the case for DVB recordings (the offset is 0), so I dont know what should be done with the first 38 bytes of the file.
|
|
Top |
|
 |
Greg Frost
|
Posted: Wed May 25, 2005 6:12 am |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
I have added a version 0.3 to the wiki  . Please give it a try stdim and let me know how it goes. If it cant find any type 9 markups, it looks for type 6 markups and multiplies the mark by 12 to get the frame number. I have dealt with the first 38 bytes problem by just copying the data up to the file offset for the first mark verbatim regardless.
I have tried it with one of my dvb recordings and it still works for them.
By the way, #knoppmyth is the IRC channel on irc.freenode.net. It can be easier to work through problems in IRC with synchronous communication rather than having slow turnaround communication via the forum. Well done for providing excellent information in your previous post though!
|
|
Top |
|
 |
stdim
|
Posted: Thu May 26, 2005 1:16 am |
|
Joined: Thu Aug 05, 2004 1:57 am
Posts: 9
|
Hello Greg,
Sorry for the delay but I can test at home...but reply to you at the office...you khow!!!...
Your reply was very quick ...
...and your version 0.3 seams to do the job....
...I told you .....it is a "great piece of software" (the idea is very nice)
Unfortunately I had not much free time yesterday to do more tests, just one hour show....
I only noticed some interference around the cut point ( I mean even if the video is cut , audio continues for 1-2 seconds....) ... but do not bother for it until I will re-check it....
the overall impression is the it works fine!!!!!!!..............
I include some info about the test....
==here is your log=================================================
Running Greg Frost's Crude Commercial Cutter
arg 0 = 'mythtranscode'
arg 1 = '-c'
arg 2 = '1003'
arg 3 = '-s'
arg 4 = '2005-05-25T21:12:00'
arg 5 = '-p'
arg 6 = 'autodetect'
arg 7 = '-d'
arg 8 = '-l'
Chanid: 1003
database time 2005-05-25T21:12:00 is Wed May 25 21:12:00 2005
start time is Wed May 25 21:12:00 2005
Ignoring profile 'autodetect' specification.
Ignoring -d (not really sure what it does).
Using cutlist (which will be used regardless).
Connected to the database successfully!
Query for end time
SELECT endtime FROM recorded WHERE chanid = 1003 AND starttime = '2005-05-25T21:12:00'
Queried the database successfully!
Result with 1 fields
Endtime is:
2005-05-25 22:11:00database time 2005-05-25 22:11:00 is Wed May 25 22:11:00 2005
The start time is Wed May 25 21:12:00 2005
The end time is Wed May 25 22:11:00 2005
UPDATE jobqueue SET status=4 where chanid=1003 and starttime=20050525211200 and type=1
set jobqueue status to running
Input File Full Path: /myth/tv/1003_20050525211200_20050525221100.nuv
Output File Full Path: /myth/tv/1003_20050525211200_20050525221100.nuv.tmp
SELECT cutlist FROM recorded WHERE chanid = 1003 AND starttime = '2005-05-25T21:12:00'
Queried the database successfully!
Result with 1 fields
Cutlist is:
57 - 13060
33441 - 39553
58101 - 64923
70864 - 77686
Will delete the original recording
Cutlist 0: 57 - 13060
Cutlist 1: 33441 - 39553
Cutlist 2: 58101 - 64923
Cutlist 3: 70864 - 77686
SELECT mark,offset FROM recordedmarkup WHERE chanid = 1003 AND starttime = '2005-05-25T21:12:00' AND type=9
Queried the database successfully!
Result with 2 fields
No type 9 entries in the database. Entering experimental PVR-x50 mode
SELECT mark,offset FROM recordedmarkup WHERE chanid = 1003 AND starttime = '2005-05-25T21:12:00' AND type=6
Queried the database successfully!
Result with 2 fields
file size is 2236459536
closed input and output files
Output file size 1415658268
SELECT * FROM recorded WHERE chanid = 1003 AND starttime = '20050525211300'
new start time Wed May 25 21:13:00 2005
new end time Wed May 25 21:17:00 2005
SELECT * FROM recorded WHERE chanid = 1003 AND starttime = '2005-05-25T21:12:00'
Queried the database successfully!
Result with 25 fields
INSERT INTO recorded VALUES (1003,'20050525211300','20050525211700','test_cut','sub','descr','Manual recording','mybox.mydom',NULL,0,'',0,1,'Default',163,'','',
20050525234226,1415658268,0,0,'0000-00-00','0','0','0')
Queried the database successfully!
attempting to do what is needed to keep original
SELECT * FROM recorded WHERE chanid = 1003 AND starttime = '20050525211100'
new start time Wed May 25 21:11:00 2005
renamed /myth/tv/1003_20050525211200_20050525221100.nuv to /myth/tv/1003_20050525211100_20050525221100.nuv
UPDATE recorded SET starttime=20050525211100 where chanid=1003 and starttime=20050525211200
changed the recording start time.
UPDATE recordedmarkup SET starttime=20050525211100 where chanid=1003 and starttime=20050525211200
changed the recordedmarkup start time.
UPDATE jobqueue SET status=5 where chanid=1003 and starttime=20050525211200 and type=1
jobqueue set to stopped.
==the contents of recordedmarkup===========================
mysql> select mark,offset,type from recordedmarkup where chanid=1003 and starttime='20050525211100';
+-------+------------+------+
| mark | offset | type |
+-------+------------+------+
| 0 | NULL | -3 |
| 0 | 38 | 6 |
| 1 | NULL | 4 |
| 1 | 217126 | 6 |
| 2 | 530774 | 6 |
| 3 | 882374 | 6 |
| 4 | 1154102 | 6 |
| 5 | 1444262 | 6 |
| 6 | 1765730 | 6 |
| 7 | 2098354 | 6 |
| 8 | 2490870 | 6 |
| 9 | 3025242 | 6 |
| 10 | 3421942 | 6 |
.
.
.
.
| 1552 | 467679534 | 6 |
| 1553 | 467953354 | 6 |
| 1554 | 468229090 | 6 |
| 1555 | NULL | 5 |
| 1555 | 468517246 | 6 |
| 1556 | 468916494 | 6 |
| 1557 | 469263998 | 6 |
.
.
.
| 6941 | 2087416734 | 6 |
| 6942 | 2087710990 | 6 |
| 6943 | NULL | 4 |
| 6943 | 2088003110 | 6 |
| 6944 | 2088309610 | 6 |
| 6945 | 2088611970 | 6 |
.
.
.
| 7426 | 2233562118 | 6 |
| 7427 | 2233833758 | 6 |
| 7428 | 2234113678 | 6 |
| 7429 | 2234395646 | 6 |
| 7430 | 2234677570 | 6 |
| 7431 | 2234960038 | 6 |
| 7432 | 2235252158 | 6 |
| 7433 | 2235546326 | 6 |
| 7434 | 2235826202 | 6 |
| 7435 | 2236107538 | 6 |
| 7436 | 2236393514 | 6 |
| 8912 | NULL | 5 |
| 12052 | NULL | 4 |
| 13056 | NULL | 5 |
| 32637 | NULL | 4 |
| 34876 | NULL | 5 |
| 35726 | NULL | 4 |
| 37255 | NULL | 5 |
| 38275 | NULL | 4 |
| 39551 | NULL | 5 |
| 60351 | NULL | 4 |
| 63419 | NULL | 5 |
| 73741 | NULL | 4 |
| 77675 | NULL | 5 |
+-------+------------+------+
7454 rows in set (0.03 sec)
=======================here is the contents of recorded (sorry I deleted cutlist by mistake...but it seams in your log================
--
| chanid | starttime | endtime | title | subtitle | description | category | hostname | book
mark | editing | cutlist | autoexpire | commflagged | recgroup | recordid | seriesid | programid | lastmodified | filesize | stars | previouslyshown | origi
nalairdate | preserve | findid | deletepending |
| 1003 | 2005-05-25 21:11:00 | 2005-05-25 22:11:00 | test_cut | sub | descr | Manual recording | mybox.mydom | NULL
| 0 | NULL | 0 | 1 | Default | 162 | | | 20050525235610 | 2236436420 | 0 | 0 | 0000-
00-00 | 0 | 0 | 0 |
| 1003 | 2005-05-25 21:13:00 | 2005-05-25 21:17:00 | test_cut | sub | descr | Manual recording | mybox.mydom | NULL
| 0 | NULL | 0 | 1 | Default | 163 | | | 20050525235314 | 1415658268 | 0 | 0 | 0000-
00-00 | 0 | 0 | 0 |
========================
# ls -l /myth/tv/1003*
-rw-r--r-- 1 mythtv mythtv 2236459536 May 25 22:11 1003_20050525211100_20050525221100.nuv
-rw-r--r-- 1 mythtv mythtv 1415658268 May 25 23:45 1003_20050525211300_20050525211700.nuv
-------------------- I will be back with more info after I will re-check it.....
cheers...
and thanks on behalf of everyone...
|
|
Top |
|
 |
Greg Frost
|
Posted: Thu May 26, 2005 3:28 am |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
stdim wrote: thanks on behalf of everyone...
You're welcome, but you must be the only person with a PVR card that has even given it a go.
It is a crude cutter, and you may find that the audio is out of sync after the cut points. The fact you say the sound runs on sounds a bit ominous. This probably depends on the way the PVR card multiplexes the video and audio together. For DVB recordings, the multiplexing is probably designed so that you can start playing at any point in the stream (because you need to do this when you switch channels). The PVR is not restricted by this, so its mpeg streams may not be as happy being chopped in this crude fashion.
I look forward to your further comments.
|
|
Top |
|
 |
cdmskyler
|
Posted: Thu May 26, 2005 6:58 am |
|
Joined: Fri Jan 23, 2004 1:50 pm
Posts: 6
|
Hallo Greg
Your version 0.3 works great with my PVR250/350 recordings. No audio sync issues noticeable like cutting with avidemux. Only the new start/end time (osd and recordings screen) of a show are not correct, but the show plays ok.
Old Time: 20:15 - 20:45
Time after cutting: 20:18-20:21 (in some shows the start/end difference is 4min)
I started the cutting progress from myth menu with "X", not testet on commandline. The old show will not be deleted, could this be the problem, the
new start/end time is not correct?
Thanks for your great work
CdMSkyler
|
|
Top |
|
 |
Greg Frost
|
Posted: Thu May 26, 2005 4:17 pm |
|
Joined: Mon May 10, 2004 8:08 pm
Posts: 1891
Location:
Adelaide, Australia
|
Thanks for that reply. I adjust the duration based on the number of frames copied to the new recording. Because of the way I hacked it to work for the PVR this will be out by a factor of 12. I'll correct this minor issue and put out a 0.4 tonight.
I deliberately made it keep the old recording when working on PVR recordings because I wasn't sure if it would work yet. Since it seems to be working, I will change 0.4 so that it removes the original in the same way as it does for DVB recordings. (i.e don't remove it if there is a delete after cut in the first 25 frames).
|
|
Top |
|
 |