PDA

View Full Version : Transcoding h264 streams


Grim-Reaper
11th August 2008, 06:45
Hey there,
New Zealand free to air HD broadcasts use h264 video with HE-AAC audio, and as you can imagine these can get pretty huge for a raw .ts dump.
I (and many others) are looking for a program, or some specific settings to use in a command line program, or anything to be able to drop it to a lower bitrate for long term storage. As for codecs i imagine still using h264 would be best for size/quality.

Here's some sample .ts files (http://www.geekzone.co.nz/Fossie/4877)

Thanks to anyone that can help.

tre31
11th August 2008, 11:44
I would say that your best bet would be too use 2 pass x264 encoding, there is no way too transcode h264 too a lower bitrate without re-encoding. The benefits of 2 pass encoding are pretty much obvious - variable bitrate allocating more bits too the video that needs it, whereas what you see with dvb-t h264 transport muxes is they are constant (pretty much).

So there you have it, re-encode or just accept it, h264 size is much better than mpeg-2 (that we have in au), so I kind of find it amusing that even though you have the best situation you believe its not good enough.

Grim-Reaper
11th August 2008, 12:35
Cheers for the reply,
I guess i didn't really say it right, re-encoding is pretty much what i (and quite a few others) want to do. One person wants to drop it to DVD quality, though this would be a bit low for me. Yes HE-AAC + H264 are probably the best codecs out there for quality/filesize, but the video is obviously high bitrate as it is HD.
Just a program (or a batch script) that can drop the quality and therefore file size to something smaller for archiving, otherwise i'm going to be buying many hard drives.
I don't mind if a documentry i recorded 6 months ago isnt the full 720p its meant to be, if it'll save hard disk space.

If someone could point me to the right programs for demuxing a .ts file to audio/video, then reencoding the h264 and he-aac latm audio, i might be able to get the right command line parameters to try it myself and make a batch script, but help would obviously be nice.

tre31
11th August 2008, 15:42
h264ts_cutter_v111 - editing .ts if you need too
dgavcdec - get latest version in mpeg4 forum - can demux .ts stream into raw .avc, not sure about audio, but you can try.

Then just basically use megui too re-encode too 720p x264.

As for scripting it, well you are dealing with alpha software in some instances (dgavcdec), but I guess you could do the encoding with ffmpeg, but if you aren't experienced with x264 command lines (and even if you are) I would recommend megui, fact is with 2 pass encoding you need too calculate bitrates too hit specified file sizes.

btw you could have found this all out yourself with a little bit of research...

poisondeathray
14th August 2008, 22:24
Just to add, while everything can be done basically as tre31 says, the audio is different in freeview recordings: the audio is AAC LATM/LAOS.

Not very many programs can decode this format at this point in time. Fortunately Donald Graft recently added support in DGAVCDec v30 and later. You can demux the audio (it includes the proper delay), but then you still have to process it. If you have Winamp, you can use the disk writer plugin to convert it to .wav. I haven't found any other common apps that can process this type of audio

DirectShowSource() and AVCSource() both work for the video part. You can use audiodub() if you chose to use the DirectShowSource() method, and process them together (e.g. if you had to edit out commercials, to do both audio & video in sync). This is confirmed to work, I tested on the 1080i Boston Legal clip.