TVE Beta: Recordings causing problems with Windows Explorer

What I meant was the .mpg files are not Program Streams, but Transport Streams.

Converting the MPEG2 Transport Streams recorded by Channels DVR to MPEG4 Program Streams by remuxing may not work for playback with Channels clients.

I'm not 100% sure, but I think Channels DVR expects its recording files to be in the MPEG2 Transport Stream container it saved them in, even though the file extension is .mpg.

You could just remux the files with
ffmpeg -i "filename.mpg" -c copy "filename.ts"
This should make the Video stream 0 and add a PCR to that stream.
one of mine for example

Input #0, mpegts, from 'SportsCenter 2020-10-27-2008.mpg':
  Duration: 00:30:05.11, start: 0.016689, bitrate: 5492 kb/s
  Program 1
    Stream #0:0[0x101]: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 124 kb/s
    Stream #0:1[0x102]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1280x720, 60 fps, 59.94 tbr, 90k tbn, 120 tbc
    Stream #0:2[0x103]: Data: timed_id3 (ID3  / 0x20334449)
Output #0, mpegts, to 'SportsCenter 2020-10-27-2008.ts':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1280x720, q=2-31, 60 fps, 59.94 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac (HE-AAC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 124 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)

Try it with one of your problem files.
If that works you could delete your original recording "filename.mpg" and rename the newly remuxed file from "filename.ts" to "filename.mpg"

Thanks for the tip. Replacing the original file with the renamed ffmpeg copy worked well. Channels clients still play the file without issue, and the file no longer causes Windows Explorer to hang.

Yep, works great.
Since it's just a remux it runs quickly.

If anyone is wondering what happened to

Stream #0:2[0x103]: Data: timed_id3 (ID3  / 0x20334449)

since it's not in the output.
It's timed metadata in ID3 format. Not anything needed in a recording.
If you're curious you can do a web search for timed_id3 or timed id3 metadata

Just wanted to say this before anyone does a mass remux of their TVE recordings.
You may want to wait until the devs respond before doing any mass remuxing.

Not all TVE recordings have this issue.
After you remux and replace your original recording file with the remuxed one you may have to;
1 Refresh Metadata (fast)
2 Regenerate Video Index (fairly fast)
3 Redetect Commercial (slow)
Post Remux and rename steps

Sample size of one, but Channels kept the same metadata and com skip info, when I replaced the original file with the remux. But, the warning is a good one. I certainly don't have the need to mass remux everything. Most of my recordings are watched and deleted. But, occasionally there are files I want to archive myself.

Shame this issue still persists.
I have now been trying to deal with this.

Suggested a option added so that the server would do a post processing step of a quick remux to a different container format, like .mkv/.mp4.

Since it seems very clear to me that something in the way Channels is writing the file out/capturing the data, and writing the file headers and metadata, is the issue here. Cause, 100% fix is to remux the file with nearly any program, i have uses mkvtoolnix, shannaencoder or ffmpeg.

I have used Emby, some time ago, when i first had this issue, with Channels connected to it as a test, and its .ts file was fine. Also, using the url list export, can load the same channel up in VLC and use its capture option and that file is fine.

Edit: If Channels DVR can not be "fixed" or such a workaround added to it....then, is there some possible solution in tweaking Windows? Like a system setting, registry change, etc, to prevent the file Explorer from trying to read the file as a video, or generate a thumbnail? What about a third party program that would replace the Exploere thumbnail generation? I recall when i have install codec packs in the past, like Klite, it makes it so that Exploer can make thumbnails of files it could not before.

No, the issue is that Channels is writing out what they're given. You associate this issue with Channels, because that is how you receive these streams. But, the issue is really that the streams are messed up when they're received.

Yes, a remux could fix this. But that is not what the issue is at the root; the issue is that the streams are crap when they're received, and can only be "good" when they are post-processed.

1 Like

So.....then not doing anything to fix what you can in the mean time...is ok then.
Adding a remux option, that fixes the broken file....is out of the question? why? who cares if it does not fix the root problem....that matters not, when the root problem is not fixable.

channels uses ffmpeg once, to make the file capture and make the .mpg...use it again to remux it to .mkv, then delete the .mpg and be done with it.

Unless i see proof that they have made a build that does exactly that, and that it somehow fails to work for some reason....then you can't really say or defend them in this matter. But its 100% works to do the remux using the same program ffmpeg that channels uses...so....i dont see what the fuss and rejection is about.

Problem with some TVE streams is that they lie about including the PCR in the audio stream.
There is no PCR and the audio stream is not the place for them anyways, they belong in the video stream.
Channels records everything in a Transport Stream (even though the file extension is .mpg) and a simple remux with ffmpeg fixes the lying TVE stream issue and makes Windows happy so it can parse the file details.

Capturing what is given is the reality, and how it should be. Post-processing should not be necessary (even if desired in some circumstances).

No, not true. Ffmpeg is not made for the capture. The capture is saved as-is, without outside aid. The stream is saved, bits in-bits out.

Has anyone complied a full list of affected tve channels?
That would be really useful.

exactly......so.....why can't the Channles DVR sever then do this for the user....instead of the user having to manually do this.

I guess i miss understood you when you said this then...
So Channles is already processing the video file then?
If so, then why it is making a bad file? when i can make a good file using the same program>

If you examine the recorded file and see the audio stream is the first stream (0) and (falsely says) includes the PCR, then you identified the problem ones. Not all TVE channels have this issue.

1 Like

I know this....however, aside from recording all of the TVE channels, just to check for this, is not going to happen. Just wonder if anyone who uses tve enough had thought to compile a list.

I wonder about if it is just Windows File Explorer.....and if a third party file explorer software could be instead used to browse the server file share and not be affected by this issue. Though that would not fix the issue of a bad file that the user goes to play back normally and it locks up the computer...but at least it would allow for browsing and accesing the files.

You originally mentioned you have this issue with OTA recordings in your other post. Were they from an HDHR tuner? If so, this is not the root cause.

I had tried a few 3rd party browsers, but the ones I tried, had the same issue as Windows Explorer. For me, I don't need access to the files that often, so I do just manually remux them, as outlined above.

1 Like

If you look earlier in this thread you can see some channels identified that had or didn't have the issue.
Like you, I wasn't going to check every TVE channel.
I did ID most Discovery Network channels had the issue.

Simple check is lying about PCR on Audio PID and Audio Stream being primary.
For this and other reasons, I rely on my HDHR Prime tuner for recordings instead of TVE/Locast.
One reliable TVE source I use is my local PBS.

Channels DVR has improved dramatically when recording from TVE channels. If it gets disconnected during a recording it will keep reconnecting to finish the recording and does a pretty good job splicing the parts together. Sometimes you see those parts repeating themselves in the recording because it didn't lose anything.

1 Like

It did freeze up on me at first. But i think that was due the super slow usb stick I was using at the time, and it could not keep up with the larger file size.

I now using a proper ssd and so far, ota files are fine....however, the root TV folder, if it has any affected TVE record files in it, that will then cause Explorer to start to hang, trying to load its thumbnails etc. So, then, if i do go into the folder that is a OTA, it will hang and not load, cause it already was affected by the bad TVE folders it first saw.

If it's actually the TVE recordings that cause the issue, try right clicking one of them and wait (for many minutes sometimes) until you can select Properties. Usually the offending TVE recordings show a frame rate of 48,000 fps or some such nonsense. Once you remux that offending TVE recording with ffmpeg -i "filename.mpg" -c copy "filename.ts" and rename the remuxed "filename.ts" file to "filename.mpg", Windows should be happy with it. I agree the devs should be able to figure this out and do that, but maybe they think it's just a Windows issue? After all there is no Windows client for Channels DVR.

I know how to "fix" it....but that is not the point.
I am not and can not always have to do that process....there are other users of the DVR in my family, mainly my mother, who are not tech savy and would have no clue how to do that.

And, I am trying to get away from them having to bug me every hour of the day to fix things, or to move the DVR recordings to their computer for them etc.

I just want and need the things to work right and as trouble free as possible.

Thats exactly what i want the internal ffmeg that Channels uses to do for me, automatically. Maybe it they can code in some sort of file check where it can detect this issue of the messed up file, and then trigger the extra process. and/or have it so that we can tell it to run the process on certain TVE channels when it records.