NextPVR Forums

Full Version: Transcoding and remuxing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not all Roku devices cannot handle all TS files that NextPVR can record.   Also skipping, resume, comskip etc all are noticeable slower and potentially not as accurate as with indexed containers such as mp4 and mkv files.

To solve this issue on recordings I suggest using one of the following two choices to remux from ts to mp4 in PostProcessing.bat. The Roku client will automatically use an mp4 file when found and the resume position is shared with the TS file in other clients.

Code:
"C:\Program Files\NextPVR\Other\ffmpeg.exe" -i %1 -vcodec copy -acodec copy -c:s copy -f matroska -| "C:\Program Files\NextPVR\Other\ffmpeg.exe" -i pipe: -codec copy -movflags faststart -y "%~dpn1.mp4"

or

"C:\Program Files\NextPVR\Other\ffmpeg.exe" -fflags +genpts -i %1 -movflags faststart -vcodec copy -acodec copy -c:s copy  "%~dpn1.mp4"

or in Linux

Code:
ffmpeg -i "$1" -vcodec copy -acodec copy -c:s copy -f matroska -| ffmpeg -i pipe: -codec copy -movflags faststart -y "${1%.*}.mp4"

or

ffmpeg -fflags +genpts -i "$1" -vcodec copy -acodec copy -c:s copy  -movflags faststart "${1%.*}.mp4"


If your Roku is not AC3 compatible you will not only need to remux you will need to transcode to change -acodec copy to  -acodec aac -ac 2

There are more sophisticated options but these give a good start for Roku users. I believe this approach is better the Emby or Plex approach which is to transcode on demand.


Martin
I'm curious about what others (especially Martin and sub) think about the benefits (or not) of keeping the original .ts files after the remux to .mp4. Are there clients that either can't use the .mp4 recordings or where the original .ts recordings are "better"?

So far, I've been keeping the original file, but that basically doubles my disk space usage. And I'd like to reduce that, if possible.
I can't speak for sub's clients, but NextPVR.exe depends on the PC to play MP4 so this could be concern. I haven't had trouble so far playing these files in Kodi and timely enough I asked earlier today on the Emby forum if Emby would accept these mp4 files.

It really depends on your willingness to take risk if you can answer these question

- Are you sure the ts file is high quality and not the source of the problem? I personally would only review a ts file to check for provider issues
- Are your ffmpeg parameters the best for your file source(s)? What I wrote here are only guides as they work for my use.
- Does the remux/transcode work every time?
- Are you satisfied with your ability to create a PostProcessing file especially error conditions? I won't be reviewing user submissions.
- Do you trust NSCripthelper renaming?
- How long before you watch it? If it is months later it might be hard to record
- What if something fails? Can your view the show later in via the network's app or is this a one off that is important to you.

At least you reclaim twice the space on delete.

I do like this format though and I am hoping sub can look at it as it a good format for static files even in a browser.

Martin
(2021-04-03, 03:35 PM)mvallevand Wrote: [ -> ]- Are you sure the ts file is high quality and not the source of the problem?  I personally would only review a ts file to check for provider issues
- Are your ffmpeg parameters the best for your file source(s)? What I wrote here are only guides as they work for my use.
- Does the remux/transcode work every time?
- Are you satisfied with your ability to create a PostProcessing file especially error conditions? I won't be reviewing user submissions.
- Do you trust NSCripthelper renaming?
- How long before you watch it?  If it is months later it might be hard to record
- What if something fails?  Can your view the show later in via the network's app or is this a one off that is important to you.

Sub: Can you elaborate on how the Recording Auto Transcode option works?

I'm thinking that it would/could take care of the PostProcessing scripting, renaming, failures, etc. And if we came up with 2-3 good profiles that worked well with Roku (i.e. transcoding AC3 or not, maybe transcoding to H.264 to save space, etc.) that would help with people's parameter selection problem.

I am concerned, though, about too many instances doing parallel processing if you don't have some mechanism to limit/control that. It is not at all uncommon for me to have 2-3 (sometimes 5-6) simultaneous recordings going on. And they generally all end on half-hour or hour times, so within seconds or each other.
To avoid confusing new Roku users, please don't turn this into a blog thread on transcoding in NextPVR and start a new topic.

Martin