1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

New program for 1 step TTG downloads, decryption, encoding - kmttg

Discussion in 'TiVo Home Media Features & TiVoToGo' started by moyekj, Mar 15, 2008.

  1. Jan 4, 2014 #6261 of 10411
    lpwcomp

    lpwcomp Active Member

    8,075
    2
    May 6, 2002
    John's...
    Based on this thread which google found when I searched on error 0x80071771, and the fact that the error changes, both in the kmttg auto.log.0:

    Code:
    2014_01_04_15:23:25 NOTE: container=mpeg, video=mpeg2video
    2014_01_04_15:23:25 >> Running qsfix on D:\Video\Top Chef.S11E12.Mississippi Mud Bugs.TiVo ...
    2014_01_04_15:23:25 C:\WINDOWS\system32\cscript.exe //nologo C:\kmttg\VRDscripts\qsfix.vbs "D:\Video\Top Chef.S11E12.Mississippi Mud Bugs.TiVo" "C:\kmttgmpegs\Top Chef.S11E12.Mississippi Mud Bugs.mpg.qsfix" "/l:C:\Users\J. L. Sutherland\AppData\Local\Temp\VRDLock5273737965836127034.tmp" /m /c:mpeg /v:mpeg2video 
    2014_01_04_15:23:27 ERROR: qsfix failed (exit code: 4 ) - check command: C:\WINDOWS\system32\cscript.exe //nologo C:\kmttg\VRDscripts\qsfix.vbs "D:\Video\Top Chef.S11E12.Mississippi Mud Bugs.TiVo" "C:\kmttgmpegs\Top Chef.S11E12.Mississippi Mud Bugs.mpg.qsfix" "/l:C:\Users\J. L. Sutherland\AppData\Local\Temp\VRDLock5273737965836127034.tmp" /m /c:mpeg /v:mpeg2video 
    2014_01_04_15:23:27 ERROR: ? Problem opening output file: C:\kmttgmpegs\Top Chef.S11E12.Mississippi Mud Bugs.mpg.qsfix
    2014_01_04_15:23:27 ERROR: *BADPROFILE*
    and in the VRD log:

    Code:
    2014-01-04 15:23:27 VideoReDo TVSuite started. Licensed to: JA-M073HG-GGCYVA, Version: 4.21.6.674 - Dec 12 2013, AVP On (00cf0070-5}
    2014-01-04 15:23:27 Starting up with silent and batch: 0  242dc80
    2014-01-04 15:23:27  
               ***** Loading: D:\Video\Top Chef.S11E12.Mississippi Mud Bugs.TiVo
    
    2014-01-04 15:23:27 Setting Batch QSF flag.
    2014-01-04 15:23:27 Starting stream open for: D:\Video\Top Chef.S11E12.Mississippi Mud Bugs.TiVo
    2014-01-04 15:23:27 Opening: D:\Video\Top Chef.S11E12.Mississippi Mud Bugs.TiVo in QuickStream Fix Mode.
    2014-01-04 15:23:27 After aStream open.
    2014-01-04 15:23:27 Is DVRMS: 0.
    2014-01-04 15:23:27 Tivo reader open error: 0x80071771, file: D:\Video\Top Chef.S11E12.Mississippi Mud Bugs.TiVo
    2014-01-04 15:23:27 Setting output options from profile: Audio Recode Required
    MPEG2 Program Stream
    2014-01-04 15:23:27 ProfileSupport::SetVideoFrametRate failed - Invalid MPEG-2 frame rate: 0
    2014-01-04 15:23:27 Destruct CVideoReDoDlgAutoProxy
    it appears that when VideoReDo is invoked by the kmttg service, it cannot get the MAK and thus cannot decrypt the .tivo file.
     
  2. Jan 4, 2014 #6262 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    With ffmpeg, the key is having a fonts configuration file and telling ffmpeg where it can find it. So 1st you need a fonts.conf file:
    Code:
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <!-- /etc/fonts/fonts.conf file to configure system font access -->
    <fontconfig>
    
    <!--
       DO NOT EDIT THIS FILE.
       IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
       LOCAL CHANGES BELONG IN 'local.conf'.
    
       The intent of this standard configuration file is to be adequate for
       most environments.  If you have a reasonably normal environment and
       have found problems with this configuration, they are probably
       things that others will also want fixed.  Please submit any
       problems to the fontconfig bugzilla system located at fontconfig.org
    
       Note that the normal 'make install' procedure for fontconfig is to
       replace any existing fonts.conf file with the new version.  Place
       any local customizations in local.conf which this file references.
    
       Keith Packard
    -->
    
    <!-- Font directory list -->
    
       <dir>./</dir>
       <dir>WINDOWSFONTDIR</dir>
       <dir>~/.fonts</dir>
    
    <!--
      Accept deprecated 'mono' alias, replacing it with 'monospace'
    -->
       <match target="pattern">
          <test qual="any" name="family">
             <string>mono</string>
          </test>
          <edit name="family" mode="assign">
             <string>monospace</string>
          </edit>
       </match>
    
    <!--
      Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
    -->
       <match target="pattern">
          <test qual="any" name="family">
             <string>sans serif</string>
          </test>
          <edit name="family" mode="assign">
             <string>sans-serif</string>
          </edit>
       </match>
    
    <!--
      Accept deprecated 'sans' alias, replacing it with 'sans-serif'
    -->
       <match target="pattern">
          <test qual="any" name="family">
             <string>sans</string>
          </test>
          <edit name="family" mode="assign">
             <string>sans-serif</string>
          </edit>
       </match>
    
    <!--
      Load local system customization file
    -->
       <include ignore_missing="yes">conf.d</include>
    
    <!-- Font cache directory list -->
    
       <cachedir>WINDOWSTEMPDIR_FONTCONFIG_CACHE</cachedir>
       <cachedir>~/.fontconfig</cachedir>
    
       <config>
    <!--
      These are the default Unicode chars that are expected to be blank
      in fonts.  All other blank chars are assumed to be broken and
      won't appear in the resulting charsets
    -->
          <blank>
             <int>0x0020</int>   <!-- SPACE -->
             <int>0x00A0</int>   <!-- NO-BREAK SPACE -->
             <int>0x00AD</int>   <!-- SOFT HYPHEN -->
             <int>0x034F</int>   <!-- COMBINING GRAPHEME JOINER -->
             <int>0x0600</int>   <!-- ARABIC NUMBER SIGN -->
             <int>0x0601</int>   <!-- ARABIC SIGN SANAH -->
             <int>0x0602</int>   <!-- ARABIC FOOTNOTE MARKER -->
             <int>0x0603</int>   <!-- ARABIC SIGN SAFHA -->
             <int>0x06DD</int>   <!-- ARABIC END OF AYAH -->
             <int>0x070F</int>   <!-- SYRIAC ABBREVIATION MARK -->
             <int>0x115F</int>   <!-- HANGUL CHOSEONG FILLER -->
             <int>0x1160</int>   <!-- HANGUL JUNGSEONG FILLER -->
             <int>0x1680</int>   <!-- OGHAM SPACE MARK -->
             <int>0x17B4</int>   <!-- KHMER VOWEL INHERENT AQ -->
             <int>0x17B5</int>   <!-- KHMER VOWEL INHERENT AA -->
             <int>0x180E</int>   <!-- MONGOLIAN VOWEL SEPARATOR -->
             <int>0x2000</int>   <!-- EN QUAD -->
             <int>0x2001</int>   <!-- EM QUAD -->
             <int>0x2002</int>   <!-- EN SPACE -->
             <int>0x2003</int>   <!-- EM SPACE -->
             <int>0x2004</int>   <!-- THREE-PER-EM SPACE -->
             <int>0x2005</int>   <!-- FOUR-PER-EM SPACE -->
             <int>0x2006</int>   <!-- SIX-PER-EM SPACE -->
             <int>0x2007</int>   <!-- FIGURE SPACE -->
             <int>0x2008</int>   <!-- PUNCTUATION SPACE -->
             <int>0x2009</int>   <!-- THIN SPACE -->
             <int>0x200A</int>   <!-- HAIR SPACE -->
             <int>0x200B</int>   <!-- ZERO WIDTH SPACE -->
             <int>0x200C</int>   <!-- ZERO WIDTH NON-JOINER -->
             <int>0x200D</int>   <!-- ZERO WIDTH JOINER -->
             <int>0x200E</int>   <!-- LEFT-TO-RIGHT MARK -->
             <int>0x200F</int>   <!-- RIGHT-TO-LEFT MARK -->
             <int>0x2028</int>   <!-- LINE SEPARATOR -->
             <int>0x2029</int>   <!-- PARAGRAPH SEPARATOR -->
             <int>0x202A</int>   <!-- LEFT-TO-RIGHT EMBEDDING -->
             <int>0x202B</int>   <!-- RIGHT-TO-LEFT EMBEDDING -->
             <int>0x202C</int>   <!-- POP DIRECTIONAL FORMATTING -->
             <int>0x202D</int>   <!-- LEFT-TO-RIGHT OVERRIDE -->
             <int>0x202E</int>   <!-- RIGHT-TO-LEFT OVERRIDE -->
             <int>0x202F</int>   <!-- NARROW NO-BREAK SPACE -->
             <int>0x205F</int>   <!-- MEDIUM MATHEMATICAL SPACE -->
             <int>0x2060</int>   <!-- WORD JOINER -->
             <int>0x2061</int>   <!-- FUNCTION APPLICATION -->
             <int>0x2062</int>   <!-- INVISIBLE TIMES -->
             <int>0x2063</int>   <!-- INVISIBLE SEPARATOR -->
             <int>0x206A</int>   <!-- INHIBIT SYMMETRIC SWAPPING -->
             <int>0x206B</int>   <!-- ACTIVATE SYMMETRIC SWAPPING -->
             <int>0x206C</int>   <!-- INHIBIT ARABIC FORM SHAPING -->
             <int>0x206D</int>   <!-- ACTIVATE ARABIC FORM SHAPING -->
             <int>0x206E</int>   <!-- NATIONAL DIGIT SHAPES -->
             <int>0x206F</int>   <!-- NOMINAL DIGIT SHAPES -->
             <int>0x2800</int>   <!-- BRAILLE PATTERN BLANK -->
             <int>0x3000</int>   <!-- IDEOGRAPHIC SPACE -->
             <int>0x3164</int>   <!-- HANGUL FILLER -->
             <int>0xFEFF</int>   <!-- ZERO WIDTH NO-BREAK SPACE -->
             <int>0xFFA0</int>   <!-- HALFWIDTH HANGUL FILLER -->
             <int>0xFFF9</int>   <!-- INTERLINEAR ANNOTATION ANCHOR -->
             <int>0xFFFA</int>   <!-- INTERLINEAR ANNOTATION SEPARATOR -->
             <int>0xFFFB</int>   <!-- INTERLINEAR ANNOTATION TERMINATOR -->
          </blank>
    <!--
      Rescan configuration every 30 seconds when FcFontSetList is called
    -->
          <rescan>
             <int>30</int>
          </rescan>
       </config>
    </fontconfig>
    
    Then tell ffmpeg where you can find it:
    set FC_CONFIG_DIR=<full_path_to_fonts.conf_dir_here>
    set FONTCONFIG_PATH=<full_path_to_fonts.conf_dir_here
    set FONTCONFIG_FILE=fonts.conf

    Then to get hard subs in the output video include the following as part of ffmpeg command:
    -vf "subtitles=inputFile.srt"

    (inputFile.mpg and inputFile.srt need to be in the same directory).

    To get this working within kmttg you will need to set the above font variables as global environment variables.
     
  3. Jan 4, 2014 #6263 of 10411
    mlippert

    mlippert New Member

    59
    0
    Apr 2, 2010
    Massachusetts
    James,
    Another thought. IIRC VideoRedo uses parts of the TivoDesktop to do the decoding. Is it possible that your service account can't access those parts?
     
  4. Jan 4, 2014 #6264 of 10411
    ThAbtO

    ThAbtO TiVoholic by the bay

    6,719
    7
    Apr 6, 2000
    SF Bay Area
    VRD needs Desktop fully/partially installed to recognize .TiVo files.
     
  5. Jan 4, 2014 #6265 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    The kmttg service should be set to run using same account that VRD GUI is run as which supposedly should take care of that. Perhaps James needs to double-check that service is indeed running under proper account.
     
  6. Jan 4, 2014 #6266 of 10411
    ThAbtO

    ThAbtO TiVoholic by the bay

    6,719
    7
    Apr 6, 2000
    SF Bay Area
    I was just looking on KMTTG's Recently Deleted folder and notice something quirky. Is this normal?

    On my S3 HD (652), the Deleted date all says 12/31/69 4:00pm.
    On Roamio, it displays the correct deleted dates.
     
  7. Jan 5, 2014 #6267 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    S3 information can only come from tivo.com, not the unit itself, so could be information is not saved properly @tivo.com. series 4 & later units the information comes from the local units themselves via RPC.
     
  8. Jan 5, 2014 #6268 of 10411
    lpwcomp

    lpwcomp Active Member

    8,075
    2
    May 6, 2002
    John's...
    It appears to either not be able to get the MAK or is getting the wrong MAK. I suppose it is also possible that it cannot access the dll it needs to use

    I have the kmttg service set to run on the same account I use when I first bring up the system, .\J. L. Sutherland
    (it's actually NIMITZ\J. L. Sutherland but the system insists on changing NIMITZ (my computer's name) to .)

    When I ran the decrypt from the kmttg GUI, the service ran the adscan & adcut-encode steps with no problem.
     
  9. Jan 5, 2014 #6269 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    Just to be absolutely sure, while kmttg service is running and processing, watch the Task Manager for "cscript.exe" and make sure it is running as correct user. Although in your case since it seems to fail quickly so it may be hard to catch. Best to have Task Manager sorting by name and scrolled such that processes starting with "c" are visible. If it's running with correct username then I don't know what the issue is. I just verified service mode runs are working for me with latest VRD TVSuite version on my Windows Vista laptop.
     
  10. Jan 5, 2014 #6270 of 10411
    lpwcomp

    lpwcomp Active Member

    8,075
    2
    May 6, 2002
    John's...
    I did see "cscript.exe" flash by briefly and it looked to be running as the correct user. I also did the decrypt manually, unchecked "Overwrite Existing Files", and had the service do the adscan adcut-encode and cscript definitely ran as .\J. L. Sutherland.

    I'm also out of ideas. Did I mention how much I loathe Win 8?
     
  11. Jan 5, 2014 #6271 of 10411
    lpwcomp

    lpwcomp Active Member

    8,075
    2
    May 6, 2002
    John's...
    One other piece of information, of which the significance is unknown. Icould not run the following in a regular command prompt:
    Code:
    C:\WINDOWS\system32\cscript.exe //nologo C:\kmttg\VRDscripts\qsfix.vbs "D:\Video\Top Chef.S11E12.Mississippi Mud Bugs.TiVo" "C:\kmttgmpegs\Top Chef.S11E12.Mississippi Mud Bugs.mpg.qsfix" "/l:C:\Users\J. L. Sutherland\AppData\Local\Temp\VRDLock4893369525229399174.tmp" /m /c:mpeg /v:mpeg2video 
    I had to open a Command Prompt (Admin).
     
  12. Jan 5, 2014 #6272 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    So your account doesn't have admin permissions? If not then perhaps that could be the problem.
     
  13. Jan 5, 2014 #6273 of 10411
    elprice7345

    elprice7345 Member

    145
    0
    Sep 28, 2009
    Houston, TX
    I'm making progress with the subs, but I'm getting this error now:
    Code:
    OVERWRITING EXISTING FILE: F:\TiVo\MP4\The Returned-S01E01-Camille.mpg
    >> ENCODING WITH PROFILE 'ff_tivo_subtitles' TO FILE F:\TiVo\MP4\The Returned-S01E01-Camille.mpg ...
    C:\Users\Public\Documents\kmttg\ffmpeg\ffmpeg.exe -y -i "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.mkv" -i "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt" -scodec mov_text -threads 8 -acodec ac3 -vcodec mpeg2video -vf subtitles= "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt" -b 28500k -maxrate 30000k -bufsize 4096k -ab 448k -ar 48000 -copyts -fflags genpts -f dvd "F:\TiVo\MP4\The Returned-S01E01-Camille.mpg" 
    encoding failed (exit code: 1 ) - check command: C:\Users\Public\Documents\kmttg\ffmpeg\ffmpeg.exe -y -i "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.mkv" -i "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt" -scodec mov_text -threads 8 -acodec ac3 -vcodec mpeg2video -vf subtitles= "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt" -b 28500k -maxrate 30000k -bufsize 4096k -ab 448k -ar 48000 -copyts -fflags genpts -f dvd "F:\TiVo\MP4\The Returned-S01E01-Camille.mpg" 
    ffmpeg version N-53033-g56ba331 Copyright (c) 2000-2013 the FFmpeg developers
      built on May 13 2013 22:18:29 with gcc 4.7.3 (GCC)
      configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
      libavutil      52. 31.100 / 52. 31.100
      libavcodec     55.  9.100 / 55.  9.100
      libavformat    55.  7.100 / 55.  7.100
      libavdevice    55.  0.100 / 55.  0.100
      libavfilter     3. 65.100 /  3. 65.100
      libswscale      2.  3.100 /  2.  3.100
      libswresample   0. 17.102 /  0. 17.102
      libpostproc    52.  3.100 / 52.  3.100
    Input #0, matroska,webm, from 'G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.mkv':
      Metadata:
        creation_time   : 2013-11-28 21:11:53
      Duration: 00:54:58.05, start: 0.000000, bitrate: 5678 kb/s
        Chapter #0.0: start 0.000000, end 576.360000
        Metadata:
          title           : 00:00:00.000
        Chapter #0.1: start 576.360000, end 1081.720000
        Metadata:
          title           : 00:09:36.360
        Chapter #0.2: start 1081.720000, end 1710.440000
        Metadata:
          title           : 00:18:01.720
        Chapter #0.3: start 1710.440000, end 2363.280000
        Metadata:
          title           : 00:28:30.440
        Chapter #0.4: start 2363.280000, end 2825.160000
        Metadata:
          title           : 00:39:23.280
        Chapter #0.5: start 2825.160000, end 3298.048000
        Metadata:
          title           : 00:47:05.160
        Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
        Stream #0:1(fre): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
        Metadata:
          title           : DTS 5.1
        Stream #0:2(eng): Subtitle: subrip (default) (forced)
    Input #1, srt, from 'G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt':
      Duration: N/A, bitrate: N/A
        Stream #1:0: Subtitle: subrip
    Codec AVOption threads () specified for output file #0 (G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
    Please use -b:a or -b:v, -b is ambiguous
    [mp2 @ 04d3ad60] bitrate 448 is not allowed in mp2
    Output #0, srt, to 'G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt':
        Chapter #0.0: start 0.000000, end 576.360000
        Metadata:
          title           : 00:00:00.000
        Chapter #0.1: start 576.360000, end 1081.720000
        Metadata:
          title           : 00:09:36.360
        Chapter #0.2: start 1081.720000, end 1710.440000
        Metadata:
          title           : 00:18:01.720
        Chapter #0.3: start 1710.440000, end 2363.280000
        Metadata:
          title           : 00:28:30.440
        Chapter #0.4: start 2363.280000, end 2825.160000
        Metadata:
          title           : 00:39:23.280
        Chapter #0.5: start 2825.160000, end 3298.048000
        Metadata:
          title           : 00:47:05.160
        Stream #0:0(eng): Subtitle: mov_text (default) (forced)
    Output #1, dvd, to 'F:\TiVo\MP4\The Returned-S01E01-Camille.mpg':
        Chapter #1.0: start 0.000000, end 576.360000
        Metadata:
          title           : 00:00:00.000
        Chapter #1.1: start 576.360000, end 1081.720000
        Metadata:
          title           : 00:09:36.360
        Chapter #1.2: start 1081.720000, end 1710.440000
        Metadata:
          title           : 00:18:01.720
        Chapter #1.3: start 1710.440000, end 2363.280000
        Metadata:
          title           : 00:28:30.440
        Chapter #1.4: start 2363.280000, end 2825.160000
        Metadata:
          title           : 00:39:23.280
        Chapter #1.5: start 2825.160000, end 3298.048000
        Metadata:
          title           : 00:47:05.160
        Stream #1:0(eng): Video: mpeg2video, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 28500 kb/s, 90k tbn, 25 tbc (default)
        Stream #1:1(fre): Audio: mp2, 48000 Hz, stereo, s16, 448 kb/s (default)
        Metadata:
          title           : DTS 5.1
    Stream mapping:
      Stream #0:2 -> #0:0 (subrip -> mov_text)
      Stream #0:0 -> #1:0 (h264 -> mpeg2video)
      Stream #0:1 -> #1:1 (dca -> mp2)
    Error while opening encoder for output stream #1:1 - maybe incorrect parameters such as bit_rate, rate, width or height
    What else am I missing?
     
  14. Jan 5, 2014 #6274 of 10411
    lpwcomp

    lpwcomp Active Member

    8,075
    2
    May 6, 2002
    John's...
    That's one of the things that has me confused as it is an "Administrator" account.
     
  15. Jan 5, 2014 #6275 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    It's a little tricky integrating into kmttg, but I came up with something that works and where you can avoid setting system variables for fonts. The key is to use a .bat file to do the encoding. So I created a "ff_tivo_subtitles.bat" file and from the encoding profile call it as follows (put ff_tivo_subtitles.bat under the kmttg encode folder):

    ff_tivo_subtitles.enc:
    Code:
    <description>
    mpeg2 encode with hard subs from .srt file
    
    <command>
    PWDencode\ff_tivo_subtitles.bat INPUT SRTFILE OUTPUT FFMPEG CPU_CORES
    
    <extension>
    mpeg
    
    ff_tivo_subtitles.bat:
    Code:
    set FC_CONFIG_DIR=%~dp0
    set FONTCONFIG_PATH=%~dp0
    set FONTCONFIG_FILE=fonts.conf
    set INPUT=%1
    set SRTFILE="%~n2%~x2"
    set OUTPUT=%3
    set FFMPEG=%4
    set CPU_CORES=%5
    cd "%~dp2"
    %FFMPEG% -y -i %INPUT% -threads %CPU_CORES% -acodec ac3 -vcodec mpeg2video -vf subtitles=%SRTFILE% -b 28500k -maxrate 30000k -bufsize 4096k -ab 448k -ar 48000 -copyts -fflags genpts -f dvd %OUTPUT%
    
    For completeness and future post reference I include fonts.conf file here again:
    Code:
    <?xml version="1.0"?>
    <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
    <!-- /etc/fonts/fonts.conf file to configure system font access -->
    <fontconfig>
    
    <!--
       DO NOT EDIT THIS FILE.
       IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
       LOCAL CHANGES BELONG IN 'local.conf'.
    
       The intent of this standard configuration file is to be adequate for
       most environments.  If you have a reasonably normal environment and
       have found problems with this configuration, they are probably
       things that others will also want fixed.  Please submit any
       problems to the fontconfig bugzilla system located at fontconfig.org
    
       Note that the normal 'make install' procedure for fontconfig is to
       replace any existing fonts.conf file with the new version.  Place
       any local customizations in local.conf which this file references.
    
       Keith Packard
    -->
    
    <!-- Font directory list -->
    
       <dir>./</dir>
       <dir>WINDOWSFONTDIR</dir>
       <dir>~/.fonts</dir>
    
    <!--
      Accept deprecated 'mono' alias, replacing it with 'monospace'
    -->
       <match target="pattern">
          <test qual="any" name="family">
             <string>mono</string>
          </test>
          <edit name="family" mode="assign">
             <string>monospace</string>
          </edit>
       </match>
    
    <!--
      Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
    -->
       <match target="pattern">
          <test qual="any" name="family">
             <string>sans serif</string>
          </test>
          <edit name="family" mode="assign">
             <string>sans-serif</string>
          </edit>
       </match>
    
    <!--
      Accept deprecated 'sans' alias, replacing it with 'sans-serif'
    -->
       <match target="pattern">
          <test qual="any" name="family">
             <string>sans</string>
          </test>
          <edit name="family" mode="assign">
             <string>sans-serif</string>
          </edit>
       </match>
    
    <!--
      Load local system customization file
    -->
       <include ignore_missing="yes">conf.d</include>
    
    <!-- Font cache directory list -->
    
       <cachedir>WINDOWSTEMPDIR_FONTCONFIG_CACHE</cachedir>
       <cachedir>~/.fontconfig</cachedir>
    
       <config>
    <!--
      These are the default Unicode chars that are expected to be blank
      in fonts.  All other blank chars are assumed to be broken and
      won't appear in the resulting charsets
    -->
          <blank>
             <int>0x0020</int>   <!-- SPACE -->
             <int>0x00A0</int>   <!-- NO-BREAK SPACE -->
             <int>0x00AD</int>   <!-- SOFT HYPHEN -->
             <int>0x034F</int>   <!-- COMBINING GRAPHEME JOINER -->
             <int>0x0600</int>   <!-- ARABIC NUMBER SIGN -->
             <int>0x0601</int>   <!-- ARABIC SIGN SANAH -->
             <int>0x0602</int>   <!-- ARABIC FOOTNOTE MARKER -->
             <int>0x0603</int>   <!-- ARABIC SIGN SAFHA -->
             <int>0x06DD</int>   <!-- ARABIC END OF AYAH -->
             <int>0x070F</int>   <!-- SYRIAC ABBREVIATION MARK -->
             <int>0x115F</int>   <!-- HANGUL CHOSEONG FILLER -->
             <int>0x1160</int>   <!-- HANGUL JUNGSEONG FILLER -->
             <int>0x1680</int>   <!-- OGHAM SPACE MARK -->
             <int>0x17B4</int>   <!-- KHMER VOWEL INHERENT AQ -->
             <int>0x17B5</int>   <!-- KHMER VOWEL INHERENT AA -->
             <int>0x180E</int>   <!-- MONGOLIAN VOWEL SEPARATOR -->
             <int>0x2000</int>   <!-- EN QUAD -->
             <int>0x2001</int>   <!-- EM QUAD -->
             <int>0x2002</int>   <!-- EN SPACE -->
             <int>0x2003</int>   <!-- EM SPACE -->
             <int>0x2004</int>   <!-- THREE-PER-EM SPACE -->
             <int>0x2005</int>   <!-- FOUR-PER-EM SPACE -->
             <int>0x2006</int>   <!-- SIX-PER-EM SPACE -->
             <int>0x2007</int>   <!-- FIGURE SPACE -->
             <int>0x2008</int>   <!-- PUNCTUATION SPACE -->
             <int>0x2009</int>   <!-- THIN SPACE -->
             <int>0x200A</int>   <!-- HAIR SPACE -->
             <int>0x200B</int>   <!-- ZERO WIDTH SPACE -->
             <int>0x200C</int>   <!-- ZERO WIDTH NON-JOINER -->
             <int>0x200D</int>   <!-- ZERO WIDTH JOINER -->
             <int>0x200E</int>   <!-- LEFT-TO-RIGHT MARK -->
             <int>0x200F</int>   <!-- RIGHT-TO-LEFT MARK -->
             <int>0x2028</int>   <!-- LINE SEPARATOR -->
             <int>0x2029</int>   <!-- PARAGRAPH SEPARATOR -->
             <int>0x202A</int>   <!-- LEFT-TO-RIGHT EMBEDDING -->
             <int>0x202B</int>   <!-- RIGHT-TO-LEFT EMBEDDING -->
             <int>0x202C</int>   <!-- POP DIRECTIONAL FORMATTING -->
             <int>0x202D</int>   <!-- LEFT-TO-RIGHT OVERRIDE -->
             <int>0x202E</int>   <!-- RIGHT-TO-LEFT OVERRIDE -->
             <int>0x202F</int>   <!-- NARROW NO-BREAK SPACE -->
             <int>0x205F</int>   <!-- MEDIUM MATHEMATICAL SPACE -->
             <int>0x2060</int>   <!-- WORD JOINER -->
             <int>0x2061</int>   <!-- FUNCTION APPLICATION -->
             <int>0x2062</int>   <!-- INVISIBLE TIMES -->
             <int>0x2063</int>   <!-- INVISIBLE SEPARATOR -->
             <int>0x206A</int>   <!-- INHIBIT SYMMETRIC SWAPPING -->
             <int>0x206B</int>   <!-- ACTIVATE SYMMETRIC SWAPPING -->
             <int>0x206C</int>   <!-- INHIBIT ARABIC FORM SHAPING -->
             <int>0x206D</int>   <!-- ACTIVATE ARABIC FORM SHAPING -->
             <int>0x206E</int>   <!-- NATIONAL DIGIT SHAPES -->
             <int>0x206F</int>   <!-- NOMINAL DIGIT SHAPES -->
             <int>0x2800</int>   <!-- BRAILLE PATTERN BLANK -->
             <int>0x3000</int>   <!-- IDEOGRAPHIC SPACE -->
             <int>0x3164</int>   <!-- HANGUL FILLER -->
             <int>0xFEFF</int>   <!-- ZERO WIDTH NO-BREAK SPACE -->
             <int>0xFFA0</int>   <!-- HALFWIDTH HANGUL FILLER -->
             <int>0xFFF9</int>   <!-- INTERLINEAR ANNOTATION ANCHOR -->
             <int>0xFFFA</int>   <!-- INTERLINEAR ANNOTATION SEPARATOR -->
             <int>0xFFFB</int>   <!-- INTERLINEAR ANNOTATION TERMINATOR -->
          </blank>
    <!--
      Rescan configuration every 30 seconds when FcFontSetList is called
    -->
          <rescan>
             <int>30</int>
          </rescan>
       </config>
    </fontconfig>
    
    Note that subtitles=file.srt cannot be a full path due to ffmpeg issue, so the encode.bat file above gets around that problem by changing to the srt file directory and then uses just the file + extension without the full path.

    EDIT: I cleaned things up a little from original post so that you don't need to hardcode anything in the .bat file. Just make sure the fonts.conf file goes in the kmttg "encode" folder along with the .bat & .enc files.
     
  16. Jan 6, 2014 #6276 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    One good test to try is to see if you can run VRD on non .TiVo files in service mode. So temporarily switch back to non TS downloads and using tivodecode for decrypt, and include "qsfix" task. That way "qsfix" will be run on decrypted mpeg file so MAK access won't be needed by VRD.
     
  17. Jan 6, 2014 #6277 of 10411
    lpwcomp

    lpwcomp Active Member

    8,075
    2
    May 6, 2002
    John's...
    Everything runs fine as long as I don't try to use VRD to decrypt.
     
  18. Jan 6, 2014 #6278 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    So I guess it would be good to know if anyone else running Windows 8 has same issue or if the issue is localized to your setup. I don't have Windows 8 to test with, but I have tested XP, Vista and 7 and know those work. If you have a machine available with older Windows OS would be interesting to try it on that.

    If someone here is using VRD decrypt in kmttg service mode under Windows 8 please post.
     
  19. Jan 6, 2014 #6279 of 10411
    elprice7345

    elprice7345 Member

    145
    0
    Sep 28, 2009
    Houston, TX
    Thanks very much for all your help moyekj! :)

    I followed your instructions and still get an error:
    Code:
    OVERWRITING EXISTING FILE: F:\TiVo\MP4\The Returned-S01E01-Camille.mpg
    >> ENCODING WITH PROFILE 'ff_tivo_subtitles' TO FILE F:\TiVo\MP4\The Returned-S01E01-Camille.mpg ...
    C:\Users\Public\Documents\kmttg\encode\ff_tivo_subtitles.bat "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.mkv" "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt" "F:\TiVo\MP4\The Returned-S01E01-Camille.mpg" C:\Users\Public\Documents\kmttg\ffmpeg\ffmpeg.exe 8 
    encoding failed (exit code: 1 ) - check command: C:\Users\Public\Documents\kmttg\encode\ff_tivo_subtitles.bat "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.mkv" "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt" "F:\TiVo\MP4\The Returned-S01E01-Camille.mpg" C:\Users\Public\Documents\kmttg\ffmpeg\ffmpeg.exe 8 
    ffmpeg version N-53033-g56ba331 Copyright (c) 2000-2013 the FFmpeg developers
      built on May 13 2013 22:18:29 with gcc 4.7.3 (GCC)
      configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
      libavutil      52. 31.100 / 52. 31.100
      libavcodec     55.  9.100 / 55.  9.100
      libavformat    55.  7.100 / 55.  7.100
      libavdevice    55.  0.100 / 55.  0.100
      libavfilter     3. 65.100 /  3. 65.100
      libswscale      2.  3.100 /  2.  3.100
      libswresample   0. 17.102 /  0. 17.102
      libpostproc    52.  3.100 / 52.  3.100
    Input #0, matroska,webm, from 'G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.mkv':
      Metadata:
        creation_time   : 2013-11-28 21:11:53
      Duration: 00:54:58.05, start: 0.000000, bitrate: 5678 kb/s
        Chapter #0.0: start 0.000000, end 576.360000
        Metadata:
          title           : 00:00:00.000
        Chapter #0.1: start 576.360000, end 1081.720000
        Metadata:
          title           : 00:09:36.360
        Chapter #0.2: start 1081.720000, end 1710.440000
        Metadata:
          title           : 00:18:01.720
        Chapter #0.3: start 1710.440000, end 2363.280000
        Metadata:
          title           : 00:28:30.440
        Chapter #0.4: start 2363.280000, end 2825.160000
        Metadata:
          title           : 00:39:23.280
        Chapter #0.5: start 2825.160000, end 3298.048000
        Metadata:
          title           : 00:47:05.160
        Stream #0:0(eng): Video: h264 (High), yuv420p, 1280x720, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
        Stream #0:1(fre): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
        Metadata:
          title           : DTS 5.1
        Stream #0:2(eng): Subtitle: subrip (default) (forced)
    Please use -b:a or -b:v, -b is ambiguous
    [Parsed_subtitles_0 @ 0402b2a0] Unable to open The Returned-S01E01-Camille.srt
    [AVFilterGraph @ 0003f900] Error initializing filter 'subtitles' with args 'The Returned-S01E01-Camille.srt'
    Error opening filters!
    
    ffmpeg is still having issues using the srt file. What do I need to do?
     
  20. Jan 6, 2014 #6280 of 10411
    moyekj

    moyekj Well-Known Member

    11,134
    27
    Jan 23, 2006
    Mission...
    Open a "cmd" window and run the .bat from there and post any output you get so I can see the full ffmpeg command as well as other commands that are being run. i.e. Execute this in cmd window:
    Code:
    C:\Users\Public\Documents\kmttg\encode\ff_tivo_subtitles.bat "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.mkv" "G:\Video\TV Shows\The Returned\Season 01\The Returned-S01E01-Camille.srt" "F:\TiVo\MP4\The Returned-S01E01-Camille.mpg" C:\Users\Public\Documents\kmttg\ffmpeg\ffmpeg.exe 8 
    
     

Share This Page