30 sec lag when playing .TS files recorded in MediaPortal


#1

I have a htpc running MediaPortal (1.0.2) on Windows Vista, which I use for recording tv. This works well, but the machine is somewhat noisy, and since I stream all other video content from my Win2003 server to my WDTV Live (1.01.17), I’d like to move the htpc out of my living room as well…

No problem, I thought…
MediaPortal saves recorded tv as these huge .TS files, which the WDTV should play as well.
I’ll just share the “recorded tv” folder and stream them.

And it sort of works, but there is an annoying issue.
 - When I start up one of the recorded .TS files, my WDTV Live ‘hangs’ for 30 seconds before playing. When it finally plays, the playback is smooth.
 - If I stop playback and start it again, it hangs for 30 secs again before playing. Even if it’s the same file.
 - If I fast forward (2x, 4x, …) within the video, playback is smooth. When I press play during again, it hangs.

When it hangs, it’s always for 30 secs, I think. Maybe 29 or 31, I don’t know, but close enough.
By ‘hangs’ I mean frozen frame with OSD controls and info visible.

At first I thought it might be a delay while buffering these huge files (several GB per hour recorded tv) but I have no issues with streaming other huge files. Something like a feature length 15GB 1080p x264/DTS5.1 video will start up/play/pause/stop/resume near-instantly.

Does anyone have similar experiences?
Any thoughts and insights are appreciated!

Cheers :slight_smile:


#2

No one else tried this…?


#3

Well the problem is related to the fact that mpeg2 transport streams (.ts) were originally designed for linear playback (like TV broacast)… not for players that allow random access. On top of that broadcasts are bloated with other metadata (like EPG etc…) , that depending on the software may have ended up in the final .ts files, so it isn’t exactly surprising that a standalone device with limited “brains” has more trouble playing them back. Add to that the discontinuities in the timecodes that happen after editions (i.e during commercials) and you have all the ingredients for sloppy playback on standalone devices. I tested a simple encode (not from TV) of a 720p video and compared to the ~3s it takes for the same file muxed in a .mkv to resume play after rw/ffw, it took around 8s when it was muxed as a transport stream. Even on my PC the .ts sometimes took around 3s to resume the video after a random access, compared to the near instantaneous resume of the MKV.

If you only intend to watch those recordings once you’re probably better off just waiting those 30s or so, but if you wanna keep them it might be an idea to remux them to a container better suited for storage, like MKV; besides being a lot snappier when it comes to random access, you’ll save quite a few MBs since .ts adds a lot of overhead. Unfortunately MKVtoolnix doesn’t directly handle .ts files, so I’d demux the elementary streams in the file with TsMuxer and then remux them to MKV with MKVtoolnix.


#4

Thank you for your reply and advice.

For the most part, the recordings are only viewed once, so I see your point. On the few occasions that we want to archive something, I can “manually” transcode the ts-files using HandBrake.

Thing is…our setup is pretty good, user friendly and elegant

  • and “manually”, as in the Windows dektop, is somewhat incompatible with a decent Wife Approval Factor :slight_smile:

I tried experimenting with a transcoding plugin for MediaPortal, as the elegant solution would be:

  • Start up tv server for scheduled recording

  • Record

  • Transcode .TS to suitable format

  • Move transcoded file from tv server to media server

  • Remove .TS from tv server

  • Shut down tv server

Or…I should look for another recording solution that records in a more manageable format to begin with…

…but with equally good EPG handling.

…using xmltv to preserve our current channel list and EPG-provider.

…and remote schedule administration.

…sigh…