How To Handle Japanese TV TS Files

Discuss technical and geeky things here.
Post Reply
qop123
Posts: 76
Joined: May 15th, '09, 01:57

How To Handle Japanese TV TS Files

Post by qop123 » Nov 29th, '10, 14:20

Hello~ :roll

As there seems to be some Japanese TV TS files out there, and as I assume that some people are interested in handling and editing those Japanese TV TS files, I will put up here what a little I know. This was written at 2010.11.29.


@ Japanese TV TS Files @

A Japanese TV TS file has as its video MPEG2 video stream, and as its audio AAC audio stream, and it has also other data such as one segment mobile broadcast, Japanese subtitles, pertinent information.

This is the basic knowledge.

Video - MPEG2 Stream
Audio - AAC Stream

(This is with the main terrestrial channels. The one segment mobile broadcast and some shows from satellite channels are aired with the H.264 video stream.)


@ How To Bare Cut Japanese TV TS Files @

For bare cutting Japanese TV TS files, there are two softwares that can be utilized, HDTVtoMPEG2 and MurdocCut.

These two softwares, HDTVtoMPEG2 and MurdocCut, can both cut Japanese TV TS files by a GOP unit (15 frames, 0.5 second). They both cut Japanese TV TS files straight and simple, and so they are suited for removing the margins at the head and the end, or for cutting out a scene into a file, or for cutting out several scenes into several files.

On the other hand, they can't select two or more scenes and merge them into one file properly, and so they are not suited for advanced editing. (They actually have this function, but if we use this function, it is known that there can be some problems like audio desynch, file information corruption.)

HDTVtoMPEG2 - For Bare Cutting Japanese TV TS Files (recommended)
MurdocCut - For Bare Cutting Japanese TV TS Files


@ How To Strip And Split Japanese TV TS Files @

For removing the one segment mobile broadcast stream and the SD broadcast stream from Japanese TV TS files, and for splitting Japanese TV TS files by program information, there is a software called TsSplitter.

TsSplitter can remove the one segment mobile broadcast stream and the SD broadcast stream from Japanese TV TS files. This is useful for simplifying the file structure of Japanese TV TS files.

TsSplitter can also split Japanese TV TS files by program information, and as it can also add margins when it splits Japanese TV TS files, it can also be used as a utility to cut out the margins at the head and the end of Japanese TV TS files.

TsSplitter - For Stripping And Splitting Japanese TV TS Files


@ How To Edit Japanese TV TS Files In A Lossless Manner @

For editing Japanese TV TS files by a single frame unit (1 frame, 0.033 second) in an almost lossless manner, there is a software called TMPGEnc MPEG Editor 3 for about 5,000 yen (about 50 US dollars).

TMPGEnc MPEG Editor 3 is especially tuned and aimed at Japanese TV TS files, and so it can directly read Japanese TV TS files. For the MPEG2 stream, it only re-encodes the immediate GOP unit of the cutting points, and so it can edit the MPEG2 stream in an almost lossless manner. For the AAC stream, as of now (2010.11.29), it can't edit and export the AAC stream directly, and so we have to either expand the AAC stream to the uncompressed Wave stream or re-encode the AAC stream to the Dolby Digital AC3 stream.

TMPGEnc MPEG Editor 3 - For Editing By A Single Frame Japanese TV TS Files In A Lossless Manner


@ How To Edit And Encode Japanese TV TS Files @

For editing by a single frame unit (1 frame, 0.033 second) and encoding Japanese TV TS files, there is a software called TMPGEnc 4.0 XPress for about 10,000 yen (about 100 US dollars).

TMPGEnc 4.0 XPress is similar to TMPGEnc MPEG Editor 3, but TMPGEnc 4.0 XPress can not only edit but also encode Japanese TV TS files.

But, it is said that the encoding quality of the H.264 encoder of TMPGEnc 4.0 XPress is not so high with the lower bitrate compared to the x264 encoder, and so some picky users like to use the x264 encoder as in manual encoding.

TMPGEnc 4.0 XPress - For Editing By A Single Frame And Encoding Japanese TV TS Files


@ How To Make .d2v File From Japanese TV TS Files @

For making a .d2v file from Japanese TV TS files, there is a software called DGIndex. If the video editor that is used can directly read Japanese TV TS files, that is fine, and there is no need to make a .d2v file, but as some video editors can't directly read Japanese TV TS files, there is sometimes a need to make a .d2v file to edit the video stream.

DGIndex - For Making A .d2v File To Manually Encode Japanese TV TS Files


@ How To Extract The AAC Stream From Japanese TV TS Files @

For extracting the AAC stream from Japanese TV TS files, there is a software called ts2aac.

"Example.ts PID 0x112 DELAY -315ms.aac"

ts2aac can extract the AAC stream from Japanese TV TS files, and it can do so in a precise manner. Other softwares like DGIndex can also extract the AAC stream from Japanese TV TS files, but it was found that for some TV stations (namely NHK and NTV), there can be a problem of slight audio desynch when the AAC stream is shifted to another AAC stream as when for example CMs are inserted. This ts2aac can extract the AAC stream while correnting the issue, and so it is recommended. If you are using DGIndex to make .d2v file, use -B option, because the method of counting the DELAY values are different between other editors and DGIndex, generally for 66ms. If you are using other MPEG2 readers, you don't have to use -B option.

ts2aac - For Extracting The AAC Stream To Manually Encode Japanese TV TS Files


@ How To Decode The AAC Stream To the Uncompressed Wave Stream @

For decoding the AAC stream to the Wave stream, there is a software called ToWave, with libfaad2.dll. This ToWave can both decode the AAC stream to the uncompressed Wave stream and adjust the DELAY values at the same time.

ToWave - For Decoding The AAC Stream To the Uncompressed Wave Stream


@ How To Handle The AAC Stream In A Lossless Manner @

For temporarily faking the AAC stream as if it is like a Wave stream, there is a software called FakeAacWav.

FakeAacWav can temporarily fake the AAC stream as if it is like a Wave stream so that a faked AAC stream can be edited as if it is like a Wave stream in video editing softwares. Some video editing softwares like TMPGEnc MPEG Editor 3 can't directly edit the AAC stream, and so this program can be useful.

1, extract the AAC stream from a Japanese TV TS file, with the result of "Example.ts PID 0x112 DELAY -315ms.aac"

2, drag and drop the "Example.ts PID 0x112 DELAY -315ms.aac" to FAW.exe, with the result of "Example.ts PID 0x112 DELAY 0ms_aac.wav". Now this is the faked AAC stream that can be edited like a Wave stream. It can also auto-adjust the DELAY value at this point.

3, designate the faked AAC stream as the audio and edit the video as usual, and export the audio with the setting of uncompressed, with the result of "ExampleCut.ts PID 0x112 DELAY 0ms_aac.wav"

4, drag and drop again the "ExampleCut.ts PID 0x112 DELAY 0ms_aac.wav" to FAW.exe, with the result of "ExampleCut.ts PID 0x112 DELAY 0ms.aac". This is the lossless edited AAC stream that has been synched to the edited video.

5, mux the "ExampleCut.ts PID 0x112 DELAY 0ms.aac" with the edited video, and done.

(This might not work with some AAC streams that have two or more kinds of channels, like 1ch News + 2ch Drama + 1ch News, or 2ch CM + 5.1ch Movie + 2ch CM + 5.1ch Movie. In that case, after making the edited AAC stream, replace the unnecessary parts of the edited AAC stream with a silent AAC stream with aactool.exe that is included in the ts2aac package so that the AAC stream will have a single kind of channels, and, then, the playback compatibility might be improved. When we replace the unnecessary parts of the AAC stream with a silent AAC stream, we need to do so at the last step after making the edited AAC stream. If we replace the unnecessary parts of the AAC stream with a silent AAC stream at the first step right after extracting the AAC stream from Japanese TV TS files, it didn't work at all.)

FakeAacWav - For Handling The AAC Stream In A Lossless Manner


@ How To Mux Raw Streams Into General TS Files @

For muxing raw streams into general TS files, there is a software called tsMuxeR.

tsMuxeR can mux raw streams into general TS files. It can be utilized when we want to manually reconstruct TS files.

For example,

1, export the edited raw MPEG2 stream and the edited raw FakeAacWav stream with TMPGEnc MPEG Editor 3.

2, drag and drop the edited raw FakeAacWav stream onto FakeAacWav to restore the edited raw AAC stream from the edited raw FakeAacWav stream.

3, mux the edited raw MPEG2 stream and the edited raw AAC stream into general TS files with tsMuxeR, and done.

This way, the lossless editing of both the MPEG2 stream and the AAC stream can be achieved.

tsMuxeR - For Muxing Raw Streams Into General TS Files


@ How To Demux Raw Streams From Japanese TV TS Files @

For demuxing raw streams from Japanese TV TS Files, there is a software called BonTsDemux.

This is a demuxer that was developed for Japanese TV TS files. DGIndex and ts2aac and FakeAacWav and ToWave can do the job, but if they don't work for some reasons, or if you like this BonTsDemux more, this might be a choice.

BonTsDemux - For Demuxing Raw Streams From Japanese TV TS Files


@ How To Extract Japanese Subtitles From Japanese TV TS Files @

For extracting Japanese subtitles from Japanese TV TS files, there is a software called "Caption2Ass_mod1".

Caption2Ass_mod1 can extract Japanese subtitles from Japanese TV TS files in the SRT format or in the ASS format.

(I have read somewhere that this Caption2Ass_mod1 has some bugs in counting some numbers, and it seems that that is why the timings of the lines are generally a little off. But it can be utilized anyway if we manually check and adjust the timings of the lines.)

Caption2Ass_mod1 - For Extracting Japanese Subtitles From Japanese TV TS Files


@ How To Bare Cut Japanese TV TS Files And Merge Them Into One File @

As explained in the part of "How To Bare Cut Japanese TV TS Files", HDTVtoMPEG2 can bare cut Japanese TV TS files, and it can cut out a scene into a file, or cut out several scenes into several files, but it can't select and merge several files into one file properly, because there can be audio desynch and file information corruption. If we use TsTimeKeeper, we can corrent this problem.

1, strip Japanese TV TS files with TsSplitter of other streams than the main HD stream. For that purpose, use -SD -1SEG option with TsSplitter. This step seems necessary.

2, bare cut several scenes from Japanese TV TS files and merge them into one file with HDTVtoMEPG2.

3, open the merged file with TsTimeKeepr, and process the merged file, and done.

(If these steps work with no problem, it means that we can edit Japanese TV TS files by a GOP unit. But as I experimented, these steps were still odd with the time display, and so I don't know if this really works, and so I don't much recommend it.)

TsTimeKeepr - For Correcting The Badly Merged Japanese TV TS Files

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest