Thursday, August 17, 2006
Downsizing High Definition - HTDV to DVD
Simple resizing doesn't work because applications treat the half frames as a single frames. Resizing will introduce artifacts. There are two methods of resizing these interlaced pictures. The first is merging or deinterlacing the picture, then resizing the image, the reinterlacing it again. Remember this is a video source not film. Film is interlaced by the 3:2 pulldown method, but I digress. This method is slow and produces a temporary double frame, and doubles the frame rate, these large double frames have to be resized. On my 1.8GHz machine the frames are processed only 1.5 a second. For a video containing hundreds of thousands of frames this can take a very long time.
The second method is much faster but it has problems too. You can separate the fields, resize the half frames and then weave them back together. This can produce a flicker to the video, it can also introduce a problem called "Spatial Misalignment," this is where due to resizing factors the top and bottom frame do not match up exactly.
Why just can't it be simple? I'll report back when i find a compromise between quality and speed.
Monday, August 14, 2006
Audio Sync Problems Eliminated, Finally
I loaded the elementary streams I demuxed with DGIndex into a AVS script. The resulting file information, when loaded in to VirtualDubMod, shows the video at 3 hrs 34 minutes, and the audio at 3 hrs 36 minutes. That kind of shows me that there are dropped video frames in the movie. The issue with using elementary streams, is that there is not metadata to detect and skip these dropped frames.
I demuxed again with ProjectX and this time used Cutteraman to edit the file, I'll cover this process in depth later. I indexed again with DGindex to create a D2V file. The resulting file, when loaded into VDubMod in an AVS script, shows the audio and video exactly the same length. Hot Damn! I think it's finally fixed. I'm going to mux and test it out now. Here's the script I used to test the video sync.
#Begin AVS script
LoadPlugin("c:\program files\dgmpgdec\dgdecode.dll")
LoadPlugin("c:\program files\avisynth 2.5\plugins\nicaudio.dll")
video=Mpeg2Source("k:\captured\brickyard 400\brickyard_edited.d2v")
audio=NicAC3Source("k:\captured\brickyard 400\brickyard_edited.ac3")
AudioDub(video,audio)
#eof
BTW, I'm re-encoding the audio during this process. I was originally just correcting the audio using BeSpliced, I may still do this I'm not sure. Some of the AC3 frames were of the incorrect size. Maybe I should fix it, then re-encode it... More on that later.
I'm maintaining a list of software I'm discussing on this post.
Sunday, August 13, 2006
Audio Sync Problems Revisited
I am demuxing the TS file with DGIndex, part of DGMpgDec, at the advice on someone from Doom9's forums. I'm going to attempt to edit out the commercials and remux the video. There's not a whole lot of software out their made to mux Mpeg2 program streams from elementary streams. Most are geared toward DVD authoring so they don't want the 1920x1080 source. I would like to be able to test the edited file for sync issues before I spend 24 hours re-encoding it to 720x480 anamphorphic Mpeg2.
Friday, August 11, 2006
Major Sync Problems Encountered
Apparently I'm not the only one with these problems. It seems that it has something to do with missing packets in the stream. When these files are demuxed with DGIndex the missing packets are simply ignored. Over the course of my 3 1/2 hour video capture the audio file is allmost a full minute longer than the video. I'm trying to capture and encode a Nascar Race so a small difference isn't really noticable. The post-race interviews, however, look like something out of an old KungFu movie.
I originally tried to run the files through ProjectX with some different setting to no avail. Then I attempted to run my PVA files through Mpeg2repair, which was originally written for Transport Stream, TS, files but should be able to handle and correct these files, but it doesn't seem to recognize the video stream. I then downloaded a commercial application called VideoRedo. The purchase price is $50 which is a little steep for my budget, especially since some of the most useful video and audio apps are free under the GNU GPL. Here's a quick list
- GordianKnot - DVD to AVI utility
- AviSynth2 - Frameserving and Preprocessing
- DGMpgDec - Mpeg2 decoder, indexer, deinterlacer, frameserver.
- VirtualDubMod - VFW video processor
- BeSweet - Audio apps by DSPGuru
- CDex - CD ripping utility
- Juice Receiver - Podcast downloading
- FFDshow - VFW codecs, slow development but there are newer builds lurking around the web. Official Build - Celtic Druid Build - Experimental Builds
- Audacity - Linear audio editing software. Awesome for making mp3 ringtones
- Xiph.org - Audio and video codecs like Ogg Vorbis and Theora, some are BSD licensed
- Rarewares - collection of audio and video encoders and codecs including Lame Mp3
Thursday, August 10, 2006
Adventures in HDTV Capture: Part 3 -Capture
[Screenshot Coming]
After scanning for and setting up my channels. I tuned to NBC where the Nascar Race for the Chase are broadcasts. I used Antenna Web and Titan TV to ensure that I had all available channels entered. I also had to manually edit in some channels to receive them, but these were small independent stations and generally too weak to get a good signal. Keep in mind that DVB-T channels can run multiple streams. The NBC affiliate station in Memphis also broadcasts a music video channel and a local weather channel, all on channel 51.
A few other configuration issues I needed to change before I could capture. I had to edit my recording setting to select the option to capture to PVA. This saves the the file with the ".pva" extension. Depending on your capture program you should also be able to change this setting.
technical: PVA is a double acronym that stands for PES Video/Audio while PES stands for Packetised elementary stream. It's just a bit for bit copy of your video with no header or trailer.
Hard Drive Storage:
I selected my second hard drive, a 250 GB SATA drive formatted with NTFS. Keep in mind that you need about 1 GB to record 10 minutes of HD broadcasting at 1080i. I should be able to keep about 40 hours of video on this drive, but that's just for storage. I also need room to demux, separate the audio from the video, so now its 2 GB for HD video, and once I have the commercials edited out I need another 2/3 of a GB. I also need room on this drive to save the encoded video and audio and remux the final project and author my DVD. So my rough calculations tell me that I can only record about 10 hours of video to this drive, assuming I don't delete the output of any intermediate steps and I'm not about to delete any of my steps until I'm absolutely sure I haven't made any mistakes, and my final product looks professionally recorded.
I changed the file split size to 4096 MB, That's not really necessary on an NTFS partition, but I wanted to be sure that if I needed to resync the video to the audio that I would have some start and endpoints to manipulate. YMMV. If you have any input on the subject I'd be glad to hear it.
That's all the setup we need, when your show starts just hit the record button and nothing else needs to be done. DVBViewer will automatically record your show to the drive you selected and you will find the PVA files there after you click Stop. DVDViewer also has a electronic programming and time recording feature that you can check out. But manual recording is all I need.
Next time I'll discuss how I demuxed my files and checked them for errors.
Adventures in HDTV Capture: Part 2
Ok, so I'm all set up to capture and I've read the forums and guides at Doom 9 and I've determined the steps I need to take to capture, edit and encode my video.
In this post I'll describe these steps and list the software that I'm going to use to accomplish these tasks. I'll probably keep this post updated to reflect other software I've discovered I needed so if you're following this adventure you might need to refer back to this post. Go ahead and bookmark it now. As I post each step I'll edit the list below to link to the post.
Steps
- Capture - Record the video
- Demux - Separate the Audio from the Video
- Cut Commercials - TV shows are about 1/3 commercials
- Process Audio - repair the audio track and correct the delay
- Index the file for frame serving to the encoder
- Avisynth2 Script Writing - for resizing and cropping
- Encode Video - for transfer to DVD or DivX/XviD
- Mux Audio Track - Putting it all back together
I recommend you only install the software as needed. Installing dozens of codecs, codec-packs, or video filters will only complicate the process. I recommend free open source software unless it is significantly inferior to commercial alternatives.
Software Needed- DVBViewer or other DVB Capturing Software
- Java Runtime Environment - Free to use - for ProjectX and Bitrate Calculator
- MPEG2Repair - Free to use non-commercially - Repairs your captured files
- ProjectX - Open Source - Demuxes Transport Streams
- Mpeg2Schnitt - Open Source - Cuts out commercials, edits mpeg2 elementary streams
- Cutteraman - Open Source - Cuts out commercials, edits mpeg2 elementary streams
- BeSliced and Besplit - Corrects errors in AC3 audio files
- Nero AAC Encoder - Free - Processes audio for Mpeg4 files
- BeSweet and Besweet GUI - Open Source - Awesome audio encoding software
- Helix YUY Codecs v1.2 - Licensing Unknown - Colorspace Conversion
- DGIndex - Open Source - Demuxes and Indexes Mpeg2 files, also deinterlaces
- AviSynth 2.5 - Open Source - Preprocesses video and frameserves to the encoder
- VirtualDubMod - Open Source - Video For Windows (VFW) linear video processor
- MEGUI and x264 or XviD- Open Source - Creating downloadable Mpeg4 video
- QuEnc - Open Source - Encodes video for DVD
- Other Avisynth Filters - Mostly Open Source, all free - as needed for preprocessing video
Read Part 3
Adventures in HDTV Capture: Part 1
When I bought my PCI HDTV tuner card I was stunned that I could get a device to capture and watch HDTV over-the-air broadcasts for less than $50. That's amazing because at the same time my dad was pricing set-top tuners for around $200. I purchased an Technisat Air2PC PCI tuner card sold by Broadband Technologies, that is capable of receiving ATSC HDTV signals. ATSC is the North American standard for HD Terrestrial broadcast, DVB-T. This is not the kind of card that will receive digital satellite, DVB-S, or digital cable broadcasts.
After installing the card and the DVBViewer TE (Technisat Edition). I still had problems viewing any signal although the software reporting I had an adequate signal from the card attached to a set-top amplified antenna. I email tech support and the kind folks at Broadband Technologies told my that I also needed to install the Sonic Mpeg2 decoder software that was on my installation disks. Silly me, I read through dozens of pages of documentation and the documentation never said that this software was necessary. I already have like half a dozen codecs installed that are capable of decoding MPEG-2 signals but DVBViewer needed another one.
Once Sonic was installed I got a perfect HDTV picture on my monitor. Now I don't have an HD Widescreen monitor but it is a 21" behemoth that I have set at a 1600 x 1200 resolution so that's good enough now. 1080i Broadcasts are 1920 x 1080 because my my monitor is only 1600 pixels on the horizontal axis the vertical resolution is scaled down. Now that I'm up and running I can just hit record and go. Not exactly. My next blog posts will cover my adventure of trying to capture and encode a 3 1/2 hour Nascar race. Not anything I would recommend now for a first timer. Hopefully through my exploits you'll learn how to do this yourself. Or what not to do.
Saturday, August 05, 2006
UT Bubba Sited in Memphis! Go Home REDNECKS!
For years now us Memphians have jokingly commented about our neighbors to the east being rednecks and hillbillies. Expecially those glorious idiots known as volunteers. "Hey let's go drink some shine and sit on uncomfortable metal bleachers along with 90,000 other drunken rednecks to watch a school we never would have been admitted play football." Now the evidence is clear, Memphis fans weren't simply judging people by the color of their necks. Go Tigers!
Monday, May 01, 2006
SpamWars Episode I: Attack of the Drones
When I was at home this weekend preparing for exams and doing yard work I had no idea that I was about to enter a war over a little Firefox extension called BlueFrog. It's an anti-spam utility that attempts to actively and aggressively fight spam, that is UCE, unsolicited commercial email.
I installed the extension and within 48 hours I received an email from a spammer, addressing me personally and threatening me to unregister from BlueSecurity's service or face an insurmountable amount of spam. Now I don't know if it is my military background, my sense of pride, or common sense that makes me naturally resistant to blackmail, coercion, threats, and extortion, but I would rather deal with 1000 spam emails a day than comply with these assholes.
It gets worse. I started visiting BlueSecurity's forums in order to get help on my issue and see if others had gotten similar emails. They had. But the users weren't the only concern BlueSecurity had today. They were under a DDoS attack from drone computers under control of the spammers. These are probably the same computers that are sending me unintelligble gibberish emails as I speak. As of 23:00 CDT BlueSecurity is completely offline. I managed to CoralCache their site before it tanked under the pressure, but right now that link isn't working either. Here's the BlueSecurity Communtity site CoralCache. Hopefully it's working by now.
This is about to get good. Here is the threating email verbatim:
hesperus cellular
1 message
| Efrain Mcdermott | Mon, May 1, 2006 at 5:30 PM | |
| To: EMAILADDRESSREMOVED@memphis.edu | ||
| ||