Jump to content

How to deal with corrupted .ts files.


Recommended Posts

twiggy2cents
Posted

I record tv from OTA. I occasionally have corrupted files that freezes during playback or will mess up the index and when seeking it will jump to the end. I assume this happens from blips in the stream from the antenna?  If so how would I go about saving the video?  As is I don’t transcode and just save it as the ts file. 
When this happens some times I can save it by attempt transcode or whatever it is on the playback osd.  Sometimes this doesn’twork. Is there any transcode scripts I could run after recording to fix this?  Maybe like a rebuild index?  It sucks to lose an episode due to a bad spot in the recording.  
 

Also if there is advice on how to make the file play and seek correctly can I just set it up to run as a post recording script?  Would it be fine to run on the files that don’t have errors?

Happy2Play
Posted

Pretty sure most will say convert them.  

 

twiggy2cents
Posted

Not to sound too lazy but what is the best way? Should I do a post processing script if so is there a preferred transcoder I should use? I assume it would be ffmpeg with the appropriate hardware support enabled? Also what would happen if I watched while it’s recording I assume transcoding would happen after the recording finishes?

Happy2Play
Posted

Others will have to chime in but from above there is no transcoding as you are repacking the media in a different container usually correcting the ts issue.

I would assume you can drop them all in mkvtoolnix and remux them into mkv also.

@rbjtechmay have some ideas.

  • Like 1
Posted

As @Happy2Playsays - just use a post processing script (in the 'Recording Post Processing' section on Live TV in Emby) - and use either mkvmerge (the CLI version of mkvtoolnix) or ffmpeg.  If using ffmpeg, tell it to copy or it will transcode which you don't need/want.    I would suggest going to MKV, but going to MP4 also works.     There are plenty of examples out there.

 

twiggy2cents
Posted

I got the mkv tools now.  I will look input the args needed to run it and figure out how to batch process the existing ones.
 

As for my errors due to signal quality, do you think just changing containers will fix that or do I need to rebuild the index. I’m not exactly sure what it does to the file when there is a low signal/corrupted stream part of the file. 

Posted
2 hours ago, twiggy2cents said:

As for my errors due to signal quality, do you think just changing containers will fix that or do I need to rebuild the index. I’m not exactly sure what it does to the file when there is a low signal/corrupted stream part of the file. 

Depends on the level of corruption - if it's just timing, then by putting the TS stream in a container - then the timing should be reset.   However, if it's not timing but corrupt data, then you just copy that into the container instead.   Your best bet is to try on a known trouble file and see what happens.. ;)

twiggy2cents
Posted

Thanks!  I’ll try it on a corrupted one. I think it’s just a timing thing. When it’s stormy out one of the channels is hard to get a clean signal so it will drop out some frames. I wouldn’t think it would cause it to corrupt the whole file as it’s just recording a stream. Some times Emby will play through. Other times it will choke on it and stop. 

Posted
On 2/10/2025 at 8:20 AM, twiggy2cents said:

As for my errors due to signal quality, do you think just changing containers will fix that or do I need to rebuild the index. I’m not exactly sure what it does to the file when there is a low signal/corrupted stream part of the file. 

If you have actually signal quality issues then changing the container alone may correct timing issues but that does not always mean the audio/video sync issues are fixed, this is especially true if you encode the files to compress them and the settings you use.  My HEVC settings for compression pretty much guarantee I will get out of sync issues if I do not actually use a good software solution to correct them.  This does not mean you don't have a "blip" in your video or audio but it does mean over the length of the file the sync is correct.

The only tool I have ever used that does this well, it also does frame accurate editing, is Video Redo TV Suite 6 and unfortunately that software is no longer available because the owner died 2 1/2 years ago.  I do not know of anything as good but I tried to buy it just after Dave Rosen died and could not.  There was a lot of fervor on their forums about people fearing they would loose the use of their lifetime paid for software and at that time a version appeared online that would correct that issue because it bypassed connecting to their server, which soon would be down, to authenticate.  I contacted the developer who was in the process of shutting down the company and he gave me permission to use that version since I could not buy it and it was no longer being supported or monetized by anyone if I was willing to do it at my own risk.  I have been using that version since, actually five minutes ago.  It may still be available somewhere on the internet.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...