View Full Version : H.264 Transport Stream editing/re-encoding help needed


MrVideo
10th March 2009, 19:32
I have the MeGUI suite of programs. I was directed here in order to get help in putting together an avisynth script to do what I'm going to describe.

First off, before someone says to try out the avs4you software, their avs converter program refuses to load the transport stream, so I suspect that their editor won't either.

The source file is a DVB-S2 transport stream, consisting of a single H.264 4:2:0 1080i video stream @ 17Mbps, four MPEG-1 layer II audio streams. The first three audio streams consist of the following format: 1) left/right 2: center/LFE 3) left surround/right surround (yes the 6 channels for AC3 DD5.1) The fourth stream can be ignored, dumped into the bit bucket.

I need to be able to edit the video, removing the breaks (I have no idea where the breaks are located) and converting the 6 audio tracks into AC3 DD5.1.

If it is not easy doing the editing, since I have no clue as to the timecode locations of the break, I'll be happy with taking the video and converting it to a high bitrate MPEG-2 video file, with the audio converted to AC3, or just copied to a new MPG or TS file. I can then edit the MPEG-2 with VideoReDo.

As you can probably surmise, I am a real noob when it comes to avisynth.

Thanks for any and all help in accomplishing this task.

HymnToLife
11th March 2009, 07:15
You can use DGAVCDec to load the video in an AviSynth script. Then open the script in VirtualDub or whatever and seek through it to find where the breaks are. Then simple Trim() and ++ will do the trick. It will look like:

video = AVCSource("blah.dga")

video.Trim(0, 1000) ++ \
video.Trim(2001, 3000) ++ \
video.Trim(4001, 5000)

And so on for each bit of video you want to keep. Can't tell you about the audio, though.

MrVideo
11th March 2009, 15:26
You can use DGAVCDec to load the video in an AviSynth script. Then open the script in VirtualDub or whatever and seek through it to find where the breaks are. Then simple Trim() and ++ will do the trick. It will look like.

Thanks. I'll play with it.

[P]ako
11th March 2009, 17:26
Here is a solution for the audio. Transcode each audio stream to wav. Then do as HymnToLife told you but with a modification:

video = AVCSource("blah.dga")
audio = WavSource("audio1.wav")
mixed = AudioDub(video, audio)

mixed.Trim(0, 1000) ++ \
mixed.Trim(2001, 3000) ++ \
mixed.Trim(4001, 5000)

Load the avs in virtualdub, extract the track to wav. Modify the script to do the same with audio2 and audio3 and audio4. The resulting wavs will match the video sans breaks.

MrVideo
11th March 2009, 22:35
ako;1260298']Here is a solution for the audio. Transcode each audio stream to wav. Then do as HymnToLife told you but with a modification:
[...]

Load the avs in virtualdub, extract the track to wav. Modify the script to do the same with audio2 and audio3 and audio4. The resulting wavs will match the video sans breaks.

I'll have to figure out to transcode each of the audio streams. How are the three wave streams mapped to an AC3 DD5.1 encoder? The fourth audio stream is useless and thrown away.

Thanks, the pieces are falling together.

poisondeathray
11th March 2009, 23:10
What format are the audio streams in? You could use the channel mapping in eac3to, or use avisynth and GetChannels() to map them

[P]ako
12th March 2009, 14:49
I'll have to figure out to transcode each of the audio streams.


http://forum.doom9.org/showthread.php?t=135855&highlight=bass

;)