Results 1 to 8 of 8

Thread: converting .ts files

  1. #1
    Join Date
    May 2017
    Location
    usa
    Posts
    1

    converting .ts files

    would love to have an option to have software automatically convert recorded ts file to mpeg
    wintv8 does this but i prefer using nextpvr because it can record new series, but i am having issues using videostream casting to chromecast with .ts file, cant skip ahead or go back
    thanks

  2. #2
    Join Date
    Jul 2011
    Location
    VA US
    Posts
    185
    Many here use MCBuddy
    NPVR 3.9.2/Win7ProX64/Intel Core i7-4790 Haswell Quad-Core 3.6GHz /HDHRPrime X2/Schedules Direct

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    25,490
    Videostream is already transcoding which is why you can't skip How do you play the WinTV files?

    Martin

  4. #4
    Quote Originally Posted by ldenorio View Post
    would love to have an option to have software automatically convert recorded ts file to mpeg
    wintv8 does this but i prefer using nextpvr because it can record new series, but i am having issues using videostream casting to chromecast with .ts file, cant skip ahead or go back
    thanks
    I use a semi-complex setup to automatically convert all my .ts files to .mp4. I have written a Delphi application that looks at the npvr.db3 database and gets a sorted list of any .ts files in the database with the oldest first. The program then copies that file to a special directory where it will get converted to .mp4. This is something that could be done using MCEBuddy, but I had some problems with that losing the audio on some recordings.

    What I have now is a separate Linux box where I copy the file to, and a cron job looks for a new file then runs a script that calls Handbrake command line to convert it to .mp4 and deletes the .ts file when done. The missing .ts file is the signal for my Delphi program to copy the .mp4 file to the NPVR video directory and then update the NPVR.DB3 database with the new filename and then deletes the .ts file.

    The .mp4 files end up taking between 10 and 20% of the size of the .ts file so it greatly improves my storage of them.

    I use a separate Linux box to offload the overhead of the file conversion so it doesn't affect my NPVR box which might be recording 4 shows simultaneously. There is however a Windows command line version of Handbrake that could be run on the same box.

    All in all it works pretty well and is fairly automatic. The only problems is that occasionally the SQLLite database gets stuck and it messes up NPVR until I restart the recording process and sometimes need to Vacuum the database and/or reboot. The other problem is when a filename has some foreign accented characters in the name (that's you Hawaii 5-0) and the file copy functions have problems.

    It's not quite foolproof enough for me to make available for general use, but if anyone that has Delphi experience is interested in experimenting with it I hope to have some time available to fiddle with it some more.

    FWIW, here is the Handbrake command line that I use if you want to try manually converting any files. Note this is from a bash script so the $1 is analagous to %1 in a DOS batch file.

    HandBrakeCLI -i "$1.ts" -o "$1.mp4" -e x264 -2 --turbo -m -s "1,2"

    Steve Tyrakowski

  5. #5
    Join Date
    Jan 2005
    Location
    London
    Posts
    3,153
    Quote Originally Posted by SteveTyrakowski View Post
    The missing .ts file is the signal for my Delphi program to copy the .mp4 file to the NPVR video directory and then update the NPVR.DB3 database with the new filename and then deletes the .ts file.
    Steve Tyrakowski
    Technically, you don't need to update the database with the new file name. Whilst doing so is obviously "neater", I was just pondering if not doing so might help you with your db locking issue.

    "If a .ts file is missing, it'll check the same name with .mpg/.avi/.wtv/.dvr-ms/.mp4/.mkv/m4v. Case is important. It only looks for lower case file extensions. "

    http://forums.nextpvr.com/showthread...er-transcoding

    Also make sure you don't have UpdateEPGduringLiveTV enabled as that was a common cause of db locking issues.

    I presume your bash script is dropping the dot and extension from the file name before calling the CLI. (for the benefit of others)
    “If this is the way Queen Victoria treats her prisoners, she doesn't deserve to have any.”

  6. #6
    Quote Originally Posted by gEd View Post
    Technically, you don't need to update the database with the new file name. Whilst doing so is obviously "neater", I was just pondering if not doing so might help you with your db locking issue.

    "If a .ts file is missing, it'll check the same name with .mpg/.avi/.wtv/.dvr-ms/.mp4/.mkv/m4v. Case is important. It only looks for lower case file extensions. "

    http://forums.nextpvr.com/showthread...er-transcoding

    Also make sure you don't have UpdateEPGduringLiveTV enabled as that was a common cause of db locking issues.

    I presume your bash script is dropping the dot and extension from the file name before calling the CLI. (for the benefit of others)
    If I do not update the database with the new extension, will NPVR do it, or does it just look for the other extensions when you try to play it? I need it updated so I can find out which file I need to transcode next by looking for the *.TS files in the database.

    And yes, I pass the filename with the dot and extension omitted so that the script knows how to complete the input and output filenames from it.

    Steve Tyrakowski

  7. #7
    Join Date
    Jun 2013
    Location
    Rock Hill, SC
    Posts
    173
    The extension is not kept in the database.

    When it comes time for NextPVR to play a file, it take the title of the recording, adds the .ts file extension and then searches the appropriate directory for the file name. If that file name is not found, then the title of the recording and one of the following extensions - .mpg/.avi/.wtv/.dvr-ms/.mp4/.mkv/m4v is used to create a file name and the appropriate directory is searched. This file name creation/searching process is continues until either the file name is found or all of the file extensions have been exhausted.

    It would be nice if all titles with multiple extensions were listed in the details pages so that a tile could be selected and played by file extension,not just the title.

  8. #8
    Join Date
    May 2006
    Location
    Canada
    Posts
    25,490
    The full filename is actually in the database. The Video Library is designed for playing files that are not recorded. Since non ts files can't be played on clients using the library is a better choice in most cases.

    Martin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •