Log in

View Full Version : Possible to re-encode H.264 with minimal quality loss?


sofakng
19th June 2012, 02:28
I have a lot of MPEG-TS files (.TS container but H.264 video) and playback is fine except that when you skip forward/backward or fast forward it's very sluggish and gets pixelated, etc.

I've been trying to do research and I'm guessing that they were encoding with very few reference blocks (ie. it's a capture from a DVB-S satellite stream).

When I re-encode them with Handbrake (.MP4 container) they play very, very good and seeking in the video is instant, etc, etc.

Is it possible to transcode/re-encode my MPEG-TS files with minimal quality loss? If so, what is my best bet? They are each about 2 Mbps (ie. 2 GB per hour) but I don't want to re-encode them if "minimal quality loss" requires 10+ GB per file. I'm hoping to keep the video are the same size.

Can anybody give me any advice?

AMED
19th June 2012, 04:33
Do you have to use MP4?

You could use MKVtoolnix to put your TS files in to a mkv container without loss.

Coldblackice
19th June 2012, 08:54
I'm also needing help on this issue.

AMED -- but merely taking the TS files and putting them in an mkv container won't actually change the problem within the video itself, right? Whether it's in one container or another, won't it still need an actual re-encode to get what sofakng is needing?

I have some h264 mkv's that were (sadly) encoded as Progressive, when they are most definitely Interlaced. I was hoping that it was just a matter of changing some bit/flag to change their type, but I'm fearing that that's not the case, and that they'll require either a re-encode.

Any suggestions on how to re-encode with little to none (or at least infinitesimal) quality loss?

Ghitulescu
19th June 2012, 10:05
Even better, most DVB-S2 streams can be used as such (after cutting) to build a BD (eg with tsmuxer, tsremux or multiavchd, to name a few I know, but there are many others). Not need to burn it on a BDR, you can use it as such with most if not all mediaplayers (passing the files through these tools cleans them from "garbage" and sometimes "straight them up").

sofakng
19th June 2012, 17:54
Thanks for the replies!

I've tried using FFmpeg to simply change video containers (from MPEG-TS to MP4 and MKV) but it didn't help so I'm thinking that the problem exists with the video.

Could it be that the H.264 encoding didn't use enough reference frames? ...or what else might be "wrong" with these files?

laserfan
19th June 2012, 19:13
Could it be that the H.264 encoding didn't use enough reference frames?
I'd say that's exactly the problem.

If I were in your shoes I would re-encode to a BD-compatible standard e.g. an I-frame every 24 (or 48) frames. Along with fixing your seeking problems, it would have the added benefit of being "archivable" to disc i.e. you could make a BD-5 or -9 or -25 and put it on the shelf for use in a standalone player.