Any recommendations for editing .ts files?

Freddo

New Member
For years I used a Humax PVR 9200T and copied the files (albeit slowly!!) via a USB cable to my laptop. I could then edit out the ads etc. using a natty little freebie program called HDTVtoMPEG2 (a bit of a misnomer as it will happily covert SD .ts files into shorter edited .ts files). It's a very intuitive little package and reliable. ConvertXtoDVD was my usual way of producing video DVDs of the edited product (again, highly recommended but not free!)

Now I have a HDR FOX T2 and a Humax 2000T, both of which save the programmes as non-standard .ts files which the HDTVtoMPEG2 software won't recognise. (If I understand correctly, Humax is resetting some flags in the .ts file header.) Humax customer help (another misnomer, perhaps?) won't suggest a package to edit the transferred files. I've found a clumsy and cumbersome way to edit out ads using ProjectX and Mpg2Cut2, nether of which I can wholeheartedly recommend.

Has anyone got a simpler way of doing this? I'd ideally want something that works on the PC with the transferred files, rather than something that runs in the Humax machines, as the 2000T doesn't seem to have the ability to run firmware "hacks". (If I'm wrong about this, please enlighten me!)

If all else fails, a program that could convert the .ts files into a regular, normal format that HDTVtoMPEG2 can handle would be very acceptable! Thanks.

Freddo
 
If all you want to do is simple cuts, VideoReDo is the gold standard. It edits without transcoding, and outputs to any stream type you like (without transcoding).
 
Last edited:
Freddo - I have not used the program HDTVtoMPEG2; what happens if you change the HDR-FOX recording file extension to '.m2ts'? Is the file recognised then? The file format is actually m2ts rather than ts.
The free Windows program TSMuxerGUI will quickly remux the m2ts files to proper ts files. Note that this will only work with MPEG2 files: it can cope with the H.264 video format of high def. recordings but it does not like the audio format (LATM-AAC).
 
Last edited:
Freddo - I have not used the program HDTVtoMPEG2; what happens if you change the HDR-FOX recording file extension to '.m2ts'? Is the file recognised then? The file format is actually m2ts rather than ts.
The free Windows program TSMuxerGUI will quickly remux the m2ts files to proper ts files. Note that this will only work with MPEG2 files: it can cope with the H.264 video format of high def. recordings but it does not like the audio format (LATM-AAC).

Thanks - unfortunately HDTVtoMPEG2 complains "file must have a valid extension!" so it obviously wasn't designed to accept .m2ts.

Drat and double-drat.

I'll investigate TSMuxerGUI and report back.
 
Thanks - unfortunately HDTVtoMPEG2 complains "file must have a valid extension!" so it obviously wasn't designed to accept .m2ts.

Drat and double-drat.

I'll investigate TSMuxerGUI and report back.

I've tried it and it works! Many thanks MontysEvilTwin. Also Black Hole - I'll check out the link and VideoReDo.
 
(Posted simultaneous with the above)

Why do you want to use a remuxer and another editor when you can just use VideoReDo?
 
Last edited:
Is this a good time to repeat my request for something like VideoReDo that works on Linux or Mac OSX? thanks :)

I know I could run Windows in a VM (and do), but I hate it, and the performance is dire.
 
Who is your message aimed at? Shirley you should petition the VRD team to port it to Linux?
 
It's worth mentioning that avidemux does this job perfectly for free, but only for standard density files. It will edit .ts files or .mpg files post-extraction on the Humax. Unwanted material can be marked and deleted one cut at a time and although it complains that corruption is likely if you cut other than at a key frame, I have never seen any problems. Save back as .ts and it's very fast.

It's not VideoRedo, but it's not $100 either. Oh, and I see it's available for Linux and most other flavours.
 
Well, here I am making assertions about Avidemux not working with HD files, so I decided I'd better do some checking. Anyway, I was wrong: it does work with HD files. Here's how to reduce a 2.2GB file from a Humax HDR-Fox T2 to a 1GB file minus all the unwanted bits.

First: gear. I used the following:
HP mini-PC with W8.1. Core i3-4025U processor@1.90GHz. This bit is important as I'm going to use Intel Quick Sync video and for that you need a recent Intel processor.
Avidemux 2.6.12 - 64 bit
Handbrake 0.10.2.7286 - 64-bit

File: episode 2 of series 2 of "Indian Summers" (C4). Hi-def. Auto-decrypted on the Humax and copied to the PC.

Plan A. Initially I opened the file directly in avidemux. It took a few minutes but whoo! it opened, could be edited and saved. Unfortunately the audio track was missing and I could find no way to select an alternative track. It seems avidemux likes Humax video but not Humax audio. Plan A failed.

Plan B. Open the file in Handbrake. Leave the video size unchanged and set the output to mp4. Under Video select QSV set for Constant Quality 25 Balanced. Don't touch the audio. Time to encode: 11 minutes. Output file is 1.3GB.

Open the resulting file in avidemux (it opens instantly). Use the editor to remove the lead-in, lead-out and ads. Each operation is performed separately by marking the start and end of a section to be deleted, then deleting it. There are 2 pairs of buttons to move forward and back through the file. The rightmost pair move automatically to key frames, the leftmost move to intermediate positions. If you cut anywhere other than at a key frame the program will warn you of possible corruption when you save. In fact, this corruption seems to be no more than a split-second's pixelation (Videoredo recodes these transitions, but then VRD costs a packet).

The avidemux editor is actually very good. A little less hand-holding than VRD, but after a couple of attempts you can work with it comfortably and quickly. It should take no more than 5 minutes to decrappify most files.

When all deletions are complete save the file. Audio and Video Output should both be set to Copy and Output Format - I used mp4 muxer. Save the file - it takes less than 1 minute. In this case the final file size was 1.00GB. Once you're happy with the result you can delete all the intermediate copies...

This file should be playable on most devices. It can also be copied back to your Humax, should that be your preferred modus operandi and will play with full stop/start fast wind etc. It also saves better than 50% disk space compared with the original (if you're brave enough to delete the original, that is). You can play around all you like with quality settings in Handbrake etc. and I'm sure someone will come up with a better-optimised set of instructions, but personally, I've just saved a hundred bucks on VideoReDo and I'm well pleased.

Afterthought: both Avidemux and Handbrake are available on Linux. If anyone tests them on that or any other platform, please let us know the outcome.
 
Last edited:
(Posted simultaneous with the above)

Why do you want to use a remuxer and another editor when you can just use VideoReDo?

I'll bet you can gue$$.

By the way, did you delete the link you posted? Can't see it today & I hadn't had time to follow it through.

Thanks, Black Hole! (....and thanks to others for their suggestions)

Freddo
 
By the way, did you delete the link you posted? Can't see it today & I hadn't had time to follow it through.
Yes, because this topic has now been moved to the relevant forum section - the link was only to the forum section, so surely you should be able to find that?!
 
fenlander - I bet the problem with editing the high def. file directly in AVIdemux is the LATM-AAC audio. Using ffmpeg on the HDR-FOX you can convert the audio to AAC with an ADTS header, but I wouldn't recommend it. The conversion process is slow and drops frames, which means that the audio gets more and more out of sync as the recording proceeds, so even an offset cannot resync the file. However conversion of the audio to AC3 is quite quick and flawless. You can use a command like the one below:
Code:
ffmpeg -i a.ts -vcodec copy -acodec ac3 -ab 160k b.m2ts
Ffmpeg can cope with the fact that the input file in the example (a.ts) is not a true ts file but if you give the output file the ts extension (rather than m2ts) it will create a true ts file: if you create an m2ts file and then change the extension to ts afterwards you can use the Sidecar package to recreate the hmt and nts files. In the example, the audio in the output file is set to 160k. The default is lower than this but '160k' gives a similar size file to the input and seems to preserve the audio quality (to my ears anyway).
 
How do you preserve the subtitle and audio description streams? I keep meaning to get round to checking this, but the hideous documentation for ffmpeg keeps putting me off :(.
 
Don't forget that the primary point of all this is the ability to edit the file. A secondary point is to convert the container to something universally useful and the third is to effect a useful saving of space without compromising the video quality. The ability to use Avidemux to do something for free that would be expensive with VideoReDo is the cream on the cake.

At the moment I am using the process I outlined above, except that I open the original file with Handbrake directly on the Humax instead of copying it to the PC first. At 11 minutes for a 1-hour HD file and 5 minutes for SD, I can process a batch of files very quickly and unattended. If I cared to use my i5 on it instead of the i3, I'd expect that to halved: I can't copy the file across my 10/100 ethernet much quicker than that! I don't really see much advantage in manipulating the file on the Humax. The conversion with Handbrake sorts all the audio problems, and reduces the file size: editing is then a breeze.

I admit I haven't looked at the subtitle issue and I don't use the audio description tracks. However, a further advantage of doing all this is that I can subsequently play the file using VLC instead of the Humax. VLC has an audio equaliser and I personally find the tweaked sound much clearer, to the extent that I do not need the occasional subtitles that BBC mumbling would otherwise make necessary.
 
to effect a useful saving of space without compromising the video quality.
Obviously it does. Whether you can see it or whether that matters to you is irrelevant. If there was no difference they would transmit it at a lower rate in the first place.
 
How do you preserve the subtitle and audio description streams? I keep meaning to get round to checking this, but the hideous documentation for ffmpeg keeps putting me off :(.
I haven't tried, you just get the video and primary audio streams by default.
The best solution I have found is VideoReDo; you can try it for a week free with full functionality. Version 5 of VRD preserves the DVB subtitles and all audio tracks by default, and is very quick. The thing that put me off VRD (apart from the £70 pricetag) is that I did have a problem with the audio and video going out of sync with one recording (high def. H.264 with LATM-AAC audio) after removing the adverts. I fixed this by manually setting the offset but it was a bit of a faff. Other similar recordings though were OK, so it might not be a widespread problem.
 
Obviously it does. Whether you can see it or whether that matters to you is irrelevant. If there was no difference they would transmit it at a lower rate in the first place.
Broadcast quality is itself a compromise - they could transmit it at a higher rate and get a 'better' result. Somebody made a decision where to draw the line. It's up to me if I want to draw my own line somewhere different on the quality/compression spectrum. Compromise is implicit in all consumer media storage: personally I have higher standards for images (photos) and music because they are things that I re-experience frequently. TV is (mostly) something I watch and discard. Anything I do with a video file needs to be quick, easy and effective, otherwise it's time spent to no good purpose.

I can click the skip button a couple of times to avoid ads. Any other method has got to be pretty simple or it's not worth the candle.
 
How do you preserve the subtitle and audio description streams? I keep meaning to get round to checking this, but the hideous documentation for ffmpeg keeps putting me off :(.
Sometime ago I had limited success at including subtitles by adding '-scodec copy' to the ffmpeg command. This would not work with ffpmeg version 0.10 but did work for version 2.5.3. However, if there was an error/discontinuity in the subtitle steam it would abort, which would truncate the entire recording (not just subtitles).

I haven't tried the latest version. There was a concern over the additional memory requirements for the later versions which is probably why it hasn't been updated in the repository.
 
Last edited:
Back
Top