View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Wed Oct 31, 2007 11:10 pm 
Offline
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
I'm still pretty new to MythTV and Knoppmyth, but I have been checking out some of the optioins and was looking for some more insight. The current topic of interest for me is one of the default jobs on Knoppmyth called "Transcode to Xvid". It runs
Code:
myt2xvid3 -cut "%DIR" "%FILE%"
if I remember correctly. First of all, it outputs some pretty nasty filenames (based on time & date recorded). I have found out how to fix that here:
http://www.mysettopbox.tv/phpBB2/viewto ... =myt2xvid3

Now I am curious as to what the
Code:
-cut
option does. From the code, it appears that if you set it, then it will remove your cutlist and create a new one from mythcommflag. Does that mean that if you want to setup your own cutlist (or not cut out commercials) that you would not use the -cut option? I ask because, obviously, commflagging isn't always perfect. I have setup a job that will import my commflagging into the cutlist. Then I edit that to my liking.

I just thought since there is so little documentation on this particular script that I would check if anyone knows the answer. If not, I will find out over the next several days and let you know.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 01, 2007 7:06 am 
Offline
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location: Kitsap Peninsula, Wa., United States
The -cut option seems to be telling the script to use your cut list.

ime, if you run the script automatically after a commflagging it ignores your comflags as that is not a cut list.

If you edit the capture commflags, you generate the cut list. That would then be used with the script to remove the commercials or identified portions from the capture while it is creating the xvid.

I usually clean up the Commflag/Cutlist by editing it and setting it on the key frames of the capture. Then when I run the script it automatically removes the unwanted portions as it generates the xvid.

As always Search is your friend, there are a couple of good posts in here on Editing the Cutlists - tjc wrote a good one, and so did someone else, can't remember who.


the Knoppmythwiki had an article on Editing cutlists as well.
Here it is [url]http://www.knoppmythwiki.org/index.php?page=VideoEditHowTo
[/url]
Also the mythtv docs had a little on cutlists,

Sorry I can't help more right now, but the resources are out there


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 01, 2007 8:14 am 
Offline
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
Thanks :) I have read the posts on the cutlists and I understand them, but I don't think that the myt2xvid3 script works as you explained. It is set to use a cutlist regardless of user options:
Code:
   my $nuvoptions ="--mode=XviD --nice=19 --cutlist --nodenoise --nodeinterlace --crop --multipass";
This line
Code:
   my $cut = '0';
initializes $cut to 0.

Then he sends it the option you input here:
Code:
GetOptions ("rebuild" => \$rebuild,
         "encode"   => \$encode,
         "debug"   =>   \$debug,
         "setup" => \$setup,
         "cut" => \$cut);


Then it simply clears the cutlist if $cut is 1
Code:
if ($cut == 1){
      printf("Generating cutlist\n");
      $cmd = "/usr/bin/mythcommflag --chanid $chanid --starttime $start --clearcutlist";
      print $cmd."\n";
      if(system($cmd)) { print "It looks like I was not able to generate a cutlist.\n"; }
      }


Again, after that it generates a new cutlist from your commercial flagging:
Code:
   if ($cut == 1){
   printf("Generating cutlist\n");
   $cmd = "/usr/bin/mythcommflag --chanid $chanid --starttime $start --gencutlist";
   print $cmd."\n";
   if(system($cmd)) { print "It looks like I was not able to generate a cutlist.\n"; }
   }


It seems obvious in the code that it is meant to encode using a cutlist. If you use the option "-cut" it should clear the existing cutlist and create a new one from the flagged commercials. Unfortunately, though, when I ran it without the "-cut" option, it still seemed to clear my cutlist and encode the entire recording. I will admit that I was doing this late last night, so I may have screwed up and accidentally cleared the cutlist myself, but I don't remember doing it.

I will run some further tests tonight and let you know the results.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 01, 2007 4:44 pm 
Offline
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location: Kitsap Peninsula, Wa., United States
Here is my experience using the included myt2xvd3 script

Setup 1)Show is captured, Commercials were flagged only.

A) Run myt2xvid3 with no options, it will encode the entire show with commercials intact exactly as it was captured.

B) Run myt2xvid3 -cut it will encode the entire show with Commercials intact exactly as captured.

Setup 2)Capture Show, Run Commflag and then Edit/Generate Cutlist

A) Run myt2xvid3 with no options, show will be encoded with commercials removed at the exact cutlist points.

B) Run myt2xvid3 -cut it will encode the show however it ignores the cutlist and encodes commercials as well like 1 B above.
I believe this is because you are running the -cut option twice making it redundant.

I too read the options.
The biggest thing I do not see it generate the cutlist as the script talks too.

So my experience is similar to what you found in your tests last night.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 01, 2007 10:23 pm 
Offline
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
Ok, I must have accidentally cleared the cutlist last night, because it is working how I expected tonight. If I want to use my own cutlist, I leave the "-cut" off of the options. If I want to use the flagged commercials for a cutlist, I add the "-cut" to the options. Now that I have cleared this up, I would like to see if I can take it to the next level.

Proposal: When using the "-cut" option, auto-detect whether there is a cutlist or not. If there is a cutlist, use it. If not, create a cutlist from mythcommflag and use it, then clear the cutlist after transcoding is complete. If the "-cut" option is not used, then transcode file in its entirety.

I have edited the script to this effect, but have not yet tested it. I will post my changes if it works.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 03, 2007 10:17 am 
Offline
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
Ok, I've edited the script so that when the "-cut" option is entered, it will use your cutlist if it exists. If not, it will create a cutlist from your commercial flags, and then remove that cutlist when it is through.

What is tripping me up is telling the transcoder not to use a cutlist when "-cut" is not present. It appears that nuvexport tries to use your cutlist regardless of what options you pass. I have remoted the "--cutlist" option from the script and it continues to use it. I went into /etc/nuvexportrc and commented out the
Code:
use_cutlist = yes
line. I have even tried to add an option to the myt2xvid3 script
Code:
use_cutlist=no
to no avail.

I would like a command to tell nuvexport to ignore the cutlist. Is this possible without actually clearing the cutlist that is already present?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 03, 2007 11:08 am 
Offline
Joined: Tue Jan 23, 2007 1:38 pm
Posts: 249
Location: Sweden
Not sure if I miss the point here, but if I were you I would *always* go into the actual show and check what the commflagging has come up with and generate a cutlist from the result before exporting. Thus, changing the "-cut" setting would not feel relevant at all to me.

Mythcommflag does a decent job, but some shows are too difficult for it. Especially shows with night scenes can trigger false cuts.

Cheers,
/Chris

_________________
LinHES R8.6.1
BE: AMD64X4, 4GB, Hauppauge usb tuners
FE1: Gigabyte F2A85X-UP4, nVidia GT640
FE2: Gigabyte GA-MA69GM-S2H, AthlonX2 4850E 2.5 GHz, 1GB, ASUS GEFORCE 7200GS 256MB
FE3: Asus Eeebox410


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 03, 2007 3:31 pm 
Offline
Joined: Thu Sep 27, 2007 5:44 pm
Posts: 580
I had to go in and change another file in order to make this work. This is how my Transcode to XVID job now works.

If you use the command
Code:
myt2xvid3 -cut "%DIR" "%FILE%"
one of two things will happen:
    1. If there is no cutlist, it will create a cutlist using mythcommflag, transcode the video to xvid and then remove the cutlist.
    2. If there is a cutlist, it will use the cutlist when transcoding the video to xvid.

If you use the command
Code:
myt2xvid3 "%DIR" "%FILE%"
it will transcode the video to xvid and totally ignore any commercial flagging and cutlists.

No matter which method you choose, your cutlist will be the same before transcoding as it is after.

Below are the changes that I made to /usr/local/bin/myt2xvid3. Be sure to backup your original file before making any changes. I am showing you the line before and after the code I edited/added so you can see where to add it.

Code:
        or die "Cannot connect to database: $!\n\n";
# User edited code start
                $sql = "SELECT title, subtitle, description, category, starttime, cutlist FROM recorded WHERE chanid = $chanid AND DATE_FORMAT(starttime,'%Y%m%d%H%i%s') = $start";
#User edited code end

                $statement = $db_handle->prepare($sql)


Code:
        $category = $row_ref->{category};
        # User added code start
        if ($cut == 1) {
          $cut = !($row_ref->{cutlist});
        }
        else {
        $nuvoptions ="--mode=XviD --nice=19 --nodenoise --nodeinterlace --crop --multipass";
        }
        # User added code end
        $filename = $title."-".$subtitle."-".substr $start, 0, 8;


Code:
        # Use nuvexport to do the work
        # User edited code start
         $cmd = "/usr/local/bin/nuvexport --chanid=$chanid --start=$start $nuvoptions --path=$feedpath";
        # User edited code end
        print $cmd."\n";


Code:
        #if(system($cmd)) { print "MP4Box cleanup seems to have failed\n"; }
        #User added code start
        if($cut == 1) {
                $cmd = "/usr/bin/mythcommflag --chanid $chanid --starttime $start --clearcutlist";
                print $cmd."\n";
        }
        #User added code end
        return 0;


I also had to change /etc/nuvexportrc. I had to change this line:
Code:
     use_cutlist = yes

to:
Code:
    use_cutlist = no
[/list]


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 68 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:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu