PDA

View Full Version : .TS to Xvid or x.264


m79
6th February 2007, 01:55
Hello all
Havent been around here in a while.. missed out on alot, just wondering what would be the easiest way to convert my raw .ts streams (720p) Mostly Tv Shows to xvid or even better x.264 . I have my method, but dont end up with nearly as good quality as the Tv Rips you can download from scene release groups, in the same or even bigger size range.
I also want to cut out the commercials, preferably before i encode to save time and hit a target size.
Thanks to anyone who can help me out. :D

Selur
7th February 2007, 10:54
assuming your ts. streams contain mpeg2 Material:
- use mpeg2reapair or project X to fix errors in the stream
- use megui for the conversion

m79
7th February 2007, 22:09
Yes it is an Mpeg 2 stream.
How can i edit out the commercials before converting though?
Thanks

rakf1
7th February 2007, 23:21
Use HDTVtoMPEG2 to convert .TS to .MPG, it also has commercial scan and then use meGUI to convert to xvid/x264

BTW, what program are you using to record .TS files?

m79
8th February 2007, 00:40
Im Using AltDVB to record the files..
HDTVtoMPEG2 crashes when i open the .ts file
Heres a short clip if it helps..
http://rapidshare.com/files/15431736/Hd.Clip.rar.html

rakf1
8th February 2007, 07:11
I tried the clip with HDTVtoMPEG2, its not seeing PID in transport stream, thats the reason its failing.... u can demux audio and video using mplayer, (however u cannot remove commertials)

mplayer -dumpvideo -dumpfile test.mpg hdclip.ts
mplayer -dumpaudio -dumpfile test.ac3 hdclip.ts

You then have to convert mpg to x264, ac3 to aac and mux in mp4 using MeGUI.

m79
8th February 2007, 22:25
So there is no way to edit commercials before encoding??
how would i go about hitting a target size? also i can imagine the switches between 6ch and 2 ch ac3 during commercials being a problem

Pookie
8th February 2007, 22:59
Seems to open up in MpegStreamClip v1.1

Save as MPG, and you can edit it as much as you want (I like Mpeg2cut2 for a freeware cutter)

m79
9th February 2007, 01:37
Seems to open up in MpegStreamClip v1.1

Save as MPG, and you can edit it as much as you want (I like Mpeg2cut2 for a freeware cutter)

Sweet it did, thanks!
Works Great, 15 seconds of video goes from 25 mb > 2 mb. :thanks:
http://rapidshare.com/files/15596378/Short.Clip.HD.XviD.rar.html
Only problem is it seems to bounce up and down a mm or so :S

Now to try x264.. :D

Anyone know what scene release groups use for their settings? resolution, fps etc..
The 40 min rips which are 1.2 gb look great

Thanks

SpAwN_gUy
9th March 2007, 12:15
Try theese guides... :)

http://nwgat.net/guides.htm

FreQi
14th March 2007, 02:18
So there is no way to edit commercials before encoding??
how would i go about hitting a target size? also i can imagine the switches between 6ch and 2 ch ac3 during commercials being a problem

I have become a strong advocate of ProjectX. You can use it to Cut or Trim the commercials out as well as fix the recorded stream. Then use DGIndex to create a D2V project file and AVISynth to do any processing (like de-interlace, IVTC, resize, etc). Use that AVISynth script to encode to XviD or x264.

As for audio, I recommend leaving the origianl AC3 audio you get out of ProjectX.

I wrote a step-by-step for ProjectX that I need to re-do a bit, but the info is there.

http://freqi.net/tutorials/projectx/

FlezZ
14th March 2007, 18:26
Instead of ProjectX, I use Pvastrumento for demultiplexing, mpeg2schnitt for cutting. I haven't had any problems with those, but does ProjectX have any advantage over those, rather than just being an All-In-One application?

FreQi
14th March 2007, 19:52
Well, I think doing it all in one has more advantages than you might immediately think of. Most prevalent in my mind is the time and drive space requirements.

If you use ProjectX, you cut and fix in one motion. This means you go from the Original Recording at let's say 9gig and chop it to your Fixed and Trimmed source files at maybe 7gig.

If you use Pvastrumento then mpeg2schnitt, you end up going from your 9gig recording to a 9did "fixed" set then to another 7gig trimmed set.

So imo, you're essentially wasting 9gig of drive space and at least doubling the time it takes to go through that phase if you don't use pjx. If you wan to save even more time, Pjx does have the ability to generate a d2v that's compatible with the dvd2avi generation, but I prefer to use DGIndex since that's really just adding a couple minutes in another step.

PJX also does silence replacements where if your audio goes from 5.1 to 2.0, you can replace the stereo audio with silent 5.1 at the same bitrate as your show. I think that's really handy...I'm sure there's more that I'm not thinking of.

FlezZ
15th March 2007, 18:15
Well, I did my first encoding job now with PjX. Overall, came out pretty nice, though I'm pretty sure I got to work more on the program's configuration part. What I noticed was that the program didn't show any info about I-Frames and P-Frames. I didn't get as close cuts as I would have wanted. I guess one could use VDubMod for the final encode fine cutting then to make it perfect.

FreQi
16th March 2007, 06:04
Yeah the major downside to PJX is it's not frame accurate. It cuts on the keyframes, which is what it jumps to using the arrow keys. In the past this limitation used to bother me, but it's never really been an issue. Once or twice I've hit a commercial break where I really wanted to step back just a few frames, but overall it should not be a real issue.

In any case, DGIndex will eventually be able to do frame accurate cuts, at least that's what I seem to remember. However, I'm not sure if DGIndex will be doing the stream fixing that PJX is capable of. If it does, then we will only need that one tool to do the demuxing and making, fixing and making d2v's. Maybe neuron2 can drop us a comment with more authority on that subject.

Pookie
16th March 2007, 06:35
I suspect with Project X being developed by DVB Matt in Germany, the development focus is going to be towards h264 support and less on Mpeg2.

Selur
16th March 2007, 09:05
@Pookie: Reading in the german ProjectX Forum, it doesn't seem like Matt is planing anything regarding h264 support.

FreQi
16th March 2007, 17:33
It's also true that PJX's development focuses more on the DVB transport streams (EU) than the ATSC we have here in the states. We're just pretty fortunate that it works on both as well as it does.

Edit: Am I getting off topic now? Maybe a little...

FlezZ
24th March 2007, 21:28
I still haven't found the result I'm looking for, at the close cuts part. I started using Cuttermaran for cutting, nice I- and P-frame handling. But since one has to use I-frame for every beginning cut, one again can't get very accurate beginning cuts.

DGIndex doesn't seem like a proper tool for that at all. Since I'm going to be encoding it to xvid anyway, maybe I could just do later close cutting in vdubmod with an encoded xvid file? I'm only going to cut a few frames, so it won't change the size almost at all. One thing that I don't like about this is that vdubmod removes the lame mp3 under audio information (if you check with gspot, you can see that it's gone, but before cutting it was there, ofcourse if one was using lame for encoding the audio in the first place), when the file has been cut in vdubmod.

I have seen a lot of close cut encodes, and they have the lame mp3 tag there alright.

Pookie
25th March 2007, 07:50
It depends on whether or not you wish to go the free software route. VideoRedo is frame accurate , but it is $50. They have a 2 week eval period. Have a look.

I've had good luck using Comskip on a Transport Stream file to find commercials, then demuxing with Xport.exe, and auto cutting with Cuttermaran v 1.68 or 1.69beta.

FlezZ
25th March 2007, 09:20
VideoReDo and all these frame accurate cutting tools reencode the mpeg2 file. The solution here is AViSynth! It has a TRiM command. Now, could someone please tell me, how is the proper way to cut both audio and video, so they wouldn't be out of sync, in Avisynth. These will be just some frame cuts, nothing too long.Trim(100,0,false)This seems to remove first 100frames? Will this do the job, for both audio and video and is this a proper line to add to the script at all?

FreQi
25th March 2007, 10:05
Check out theeo.

http://forum.doom9.org/showthread.php?t=107702
http://freqi.net/theeo/

It's a program I wrote for doing frame accurate cuts with AVISynth and VirtualDubMod. It was my preferred method for doing encodes, the only draw back is sometimes the AC3 audio would get cut funny and make the AC3 Fixers wig out.

If you have problems using it, let me know. I'd be happy to clear up any questions.

FlezZ
25th March 2007, 10:21
The thing is, the source I recorded from only has MP2 audio, no AC3. :o

FreQi
25th March 2007, 18:41
Ah, yes. Theeo won't work with mp2 audio. I didn't develop it with that in mind. However, I think the process would still work. All theeo does is automate some steps in making the avs files and demuxing some audio.

If you read this thread (http://forum.doom9.org/showthread.php?p=285754#post285754), I describe the steps that theeo automates. You should be able to follow them and just replace the ac3 with your mp2. I'd be interested to hear how it works out.

FlezZ
27th March 2007, 21:36
Things kinda worked out with the AVS script so... :o

But thanks for helping.

halsboss
19th September 2007, 10:06
VideoReDo and all these frame accurate cutting tools reencode the mpeg2 file.

Can someone (Pookie ?) please advise on how accurate this is - or, preferably, can VideoReDo just copy the stream as presumably that'd be a lot quicker ?

phædrus
19th September 2007, 19:44
VideoReDo will reencode only a few frames if you don't cut on a key frame. Most of the stream is just copied and passed through as is, presumably fixing errors at the same time, though. If you happen to cut exactly on GOPs (if I understand the concept properly) it will copy the entire stream without any reencoding. I think.

I'm kind of on the fence about VideoReDo. I tried it out, and sometimes, strangely, it seems to put the audio out of sync a couple of frames. Then I have to correct it again. On the other hand, if I don't run a file through VideoReDo, sometimes my mpeg2 file will play without sound on one of my computers.

It is useful, but from my experience, not flawless.

Pookie
20th September 2007, 09:04
Can someone (Pookie ?) please advise on how accurate this is - or, preferably, can VideoReDo just copy the stream as presumably that'd be a lot quicker?

If I recall, unless you cut on an I frame, it will perform encoding of only a few frames on the edge of the cut. Of course, it's too short for one to notice, and the process itself is only a few seconds in VideoRedo.

I've generally had good luck with VideoRedo, but like any of these tools, it depends on the characteristics of the source file.

halsboss
20th September 2007, 14:54
Thanks I bought VideoRedo. Happy so far. Looks a lot like a fancy Mpeg2Schnitt.