<br><br><div class="gmail_quote">On 4 July 2013 23:33, John Pilkington <span dir="ltr">&lt;<a href="mailto:J.Pilk@tesco.net" target="_blank">J.Pilk@tesco.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 04/07/13 13:43, Anthony Giggins wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<br>
On 4 July 2013 22:11, Anthony Giggins &lt;<a href="mailto:seven@seven.dorksville.net" target="_blank">seven@seven.dorksville.net</a><br></div><div class="im">
&lt;mailto:<a href="mailto:seven@seven.dorksville.net" target="_blank">seven@seven.<u></u>dorksville.net</a>&gt;&gt; wrote:<br>
<br>
<br>
<br>
    On 4 July 2013 21:27, John Pilkington &lt;<a href="mailto:J.Pilk@tesco.net" target="_blank">J.Pilk@tesco.net</a><br></div><div><div class="h5">
    &lt;mailto:<a href="mailto:J.Pilk@tesco.net" target="_blank">J.Pilk@tesco.net</a>&gt;&gt; wrote:<br>
<br>
        On 04/07/13 00:20, Michael Stucky wrote:<br>
<br>
<br>
                 OK, thanks for that.  I have a first shot at a<br>
            switchable script and<br>
                 my first .mkv file.  It plays in the frontend but I<br>
            can&#39;t step or<br>
                 use the editor on it.  I think I saw something recently<br>
            about that,<br>
                 but it&#39;s bedtime now.  I suppose MythArchive will choke<br>
            on it, too.<br>
<br>
                 Running:  mythffmpeg -i 1002_20130703195800.mkv 2&gt;&amp;1 |<br>
            grep -C 4 Video<br>
<br>
                 Input #0, matroska,webm, from &#39;1002_20130703195800.mkv&#39;:<br>
                    Metadata:<br>
                      ENCODER         : Lavf54.6.101<br>
                    Duration: 00:59:11.60, start: 0.000000, bitrate:<br>
            3008 kb/s<br>
                      Stream #0:0: Video: mpeg2video (Main), yuv420p,<br>
            720x576 [SAR<br>
                 64:45 DAR 16:9], 8153 kb/s, 25 fps, 25 tbr, 1k tbn, 50<br>
            tbc (default)<br>
                      Stream #0:1: Audio: mp2, 48000 Hz, stereo, s16,<br>
            256 kb/s (default)<br>
<br>
                 At least one output file must be specified<br>
<br>
                 John<br>
<br>
<br>
<br>
            I should have mentioned above, once the file is in an MKV<br>
            container it<br>
            is no longer in a format that MythTV considers a<br>
            &quot;recording&quot;. In other<br>
            words, it is not editable or seekable as a recording. You<br>
            need to use<br>
            &quot;mythexport&quot; or some other script like that to move it to<br>
            your MythTV<br>
            Video library where you can play, fastforward, rewind, etc.<br>
            as you would<br>
            any imported video.<br>
<br>
            Mike<br>
<br>
<br>
        Thanks for that, too.<br>
<br>
        I&#39;ve posted the new version,  mythDVBcut_20130704.sh, above the<br>
        old one here, and added a small covering note.  I hope it&#39;s useful.<br>
<br></div></div>
        <a href="http://www.mythtv.org/wiki/__MythDVBcut" target="_blank">http://www.mythtv.org/wiki/__<u></u>MythDVBcut</a><div><div class="h5"><br>
        &lt;<a href="http://www.mythtv.org/wiki/MythDVBcut" target="_blank">http://www.mythtv.org/wiki/<u></u>MythDVBcut</a>&gt;<br>
<br>
        The other part of the package, pycut_20130305.py, for use with<br>
        eg h264 recordings, is unchanged at the bottom of the page.<br>
<br>
<br>
        John<br>
<br>
<br>
    I&#39;ve been Playing with this also I&#39;ve added this section as provided<br>
    by Michael as I&#39;d much rather only make the HD recordings into mkv<br>
    only instead of the non-HD recordings which work as mpeg2<br>
<br>
       VRES=`grep Video  temp$$.txt | head -n1 | cut -f 11,11 -d&#39; &#39;`<br>
        if [ &quot;${VRES}&quot; = &quot;1440x1080&quot; ] ; then<br>
           echo &quot;HD recording Remuxing to mkv&quot; &gt;&gt; log$$<br>
<br>
<br>
           filename=`mediainfo &#39;--Inform=General;%FileName%&#39; &quot;$1&quot;`<br>
<br>
           OUTFILE=&quot;$filename&quot;.mkv<br>
<br>
           CMD=&quot;ionice -c3 mythffmpeg -fflags +genpts -i $TEMPHEAD.m2v<br>
    -i $TEMPAUDIO -vcodec copy -acodec copy $OUTFILE &quot;<br>
<br>
           # tell mythDB about new filename<br>
<br>
           echo &quot;update recorded set basename=&#39;${OUTFILE}&#39; where<br>
    chanid=$chanid and starttime=&#39;$starttime&#39;;&quot; | mysql -N<br>
    -u${DBUserName} -p${DBPassword} -h${DBLocalHostName} ${DBName}<br>
        else<br>
<br>
           CMD=&quot;ionice -c3  mplex -o &quot;$1&quot; -V -f 9 $TEMPHEAD.m2v $TEMPAUDIO&quot;<br>
           OUTFILE=&quot;$1&quot;<br>
        fi<br>
<br>
    Only Problem is mediainfo &#39;--Inform=General;%FileName%&#39; &quot;$1&quot;`<br>
    returns nothing so the intial run was as file called .mkv So I&#39;ve<br>
    since removed the filename variable and made OUTFILE=&quot;$1&quot;.mkv instead<br>
<br>
    $ mediainfo &#39;--Full&#39; /storage2/recordings/4032_<u></u>20130702074000.mpg.old<br>
<br>
    $<br>
<br>
    Cheers,<br>
<br>
    Anthony<br>
<br>
<br>
Ignore me, wrong video file used :(<br>
<br>
anyway at this stage of the script this should be<br>
<br>
filename=`mediainfo &#39;--Inform=General;%FileName%&#39; &quot;$1&quot;.old`<br>
<br>
however this still give the same value as $1 so no value here<br>
<br>
but seems to work perfectly<br>
<br>
<br>
Cheers,<br>
<br>
Anthony<br>
<br>
</div></div></blockquote>
<br>
Yes, it makes sense to make the choice depend on resolution, and I had wondered before about marking as transcoded - but I don&#39;t think the mythcenter-wide theme makes that flag available.  There should probably be a check to prevent the script working on an mkv file, too - although input of the filename ought to give that automatically.<br>

<br>
I&#39;ve occasionally found that a programme recorded shortly after the startup of a part-time channel can be edited but will then take the pycut route.  A second pass with no cutlist will usually fix that.<br>
<br>
Also, very rarely, ProjectX will find a backward jump in a timestamp and lose the rest of the recording.  Once or twice I&#39;ve taken steps to fit things back together but it&#39;s very rare here and not often worth the effort.<br>

<br>
I haven&#39;t tested all possibilities, obviously, but it worked on my SD recordings.  Now I think I&#39;ll set it back to non-mkv working.<br>
<br>
Cheers,<div class="HOEnZb"><div class="h5"><br>
<br>
John<br>
<br>
<br>
<br></div></div></blockquote><div>Hi John,<br><br>I&#39;ve been running this manually for some time however should I be able to run this as a userjob?<br><br>each time I try it fails <br><br> Jul 11 22:05:19 mythtv mythlogserver: mythbackend[2678]: E UserJob_18837 jobqueue.cpp:2444 (DoUserJobThread) JobQueue: User Job &#39;mythDVBcut.sh 4003_20130710192500.mpg&#39; failed.<br>
<br>however if I run the command manually as the same user ie. mythtv is runs without any errors?<br><br>Cheers,<br><br>Anthony<br></div></div><br>