Realtime Software MPEG2 Encoding Under Unix? 10
drix asks: "As part of a pet project I'm working on I need to encode MPEG2 video in realtime on Linux. I realize that there are many dedicated hardware boards being built explicitly for this purpose, but they are too expensive and I can't justify spending thousands of dollars for a hobby project. Currently several companies such as CinemaCraft and Ligos are advertising the ability to do realtime, DVD-quality MPEG2 encoding with heavily optimized software on a modestly powerful, PIII-700ish system, however all their products or SDKs are Windows based. I'm curious if anyone knows of similiar products designed to work on Linux. As an alternative, how much CPU would be needed to just 'brute-force' realtime, DVD-quality encoding using the standard (albeit sloooo) mpeg2encode program distributed by MPEG? Intel claims that a P3 1GHz can encode at 30fps, but apparently they turned down the quality, as this does not seem to be the experience of people on various newsgroups when trying to get DVD-like video."
nope hardware only (Score:1)
hardware is the only way to go
sorry
john jones
It can't be done right now (Score:1)
If anybody can find inexpensive hardware MPEG2 encoders that have linux support I'd really appreciate it, as I've started playing with digital video and my DV camcorder.
The TiVO has hardware MPEG2 encoding and runs linux but I don't think you can get the drivers or hardware.
maybe check out vcr.. (Score:2)
It doesn't do mpg2, but it may be close enough for you..
(file sizes aren't too bad...for 30 minutes of TV, the file is about 380MB)
Here's a cheap hardware solution (Score:1)
With Win98SE it works great; at the highest NTSC rates (S-VHS 29.997 frames) it takes less then %25 of a 700MHz Duron while churning out ~6MBs a sec of video.
I'm going to use AVI_IO [www.nct.ch](seperate $25 shareware package) with it to turn my box into a digital VCR.
Re:Here's a cheap hardware solution (Score:2)
Re:Here's a cheap hardware solution (Score:1)
MJPEG is hardly comparable to MPEG.
Although, it might work for this specific application..
sampeg, mp1e, ffmpeg (Score:2)
Mp1e is the only program that does high quality high resolution real time compression, but it does not produce MPEG2 right now, only MPEG1. That is not a problem for the quality, though: for this application there is not much difference between those two. There is currently no release version of mp1e, you have to get it from the CVS of Zapping [sourceforge.net] and it works only with V4L2. There is also the old version 1.7.1 [www.fefe.de] of mp1e, which has a much lower quality but may be easier to install.
Sampeg [uni-mannheim.de] can do real time MPEG1 and MPEG2, takes advantage of multiprocessing and is optimized for both Intel and Sun SIMD operations. It is very well written in C++, but also rather slow and there has been no update in a long time. The author is now working on an MPEG-4 encoder that should be available in the near future.
ffmpeg [sourceforge.net] is reasonably fast, is usable and under current development and supports most formats, most notably MPEG1, MPEG4 (OpenDivx compatible), DivX ;-), and Realvideo. Some more may be added soon.
VCR [stack.nl] may also be an alternative, but I have not tried that yet.
-- /. login
Arnd Bergmann <arnd at itreff dot de>, no
Re:Here's a cheap hardware solution (Score:2)
Also note that the DC10+ uses square pixels (640x480 for NTSC, 768x576 for PAL), which is a different resolution from DVD-style MPEG2 (720x480 NTSC, 720x576 PAL), so it's not an ideal card if you want to convert to DVD resolution MPEG2.
I think the DC30 does 720px though... as of course does DV capture over 1394. Of course, I shudder to think of the CPU requirements of decoding DV *and* recoding it as MPEG2, in software, in realtime. (shudder)
not mpeg, but... (Score:1)
There's MPEG and MPEG (Score:1)
However, to get real-time compression you have to make serious speed/quality trade-offs. Getting really good MPEG fast requires a lot of search for good motion compensation vectors. Getting good motion compensation for interlaced video sources requirs a lot of field combinations to be tried out. The fast algorithms just don't produce terribly good results. Similarly the fastest DCT algorithm's aren't the most accurate and so on. None of the available free encoders comes close to doing good DVD profile MPEG in real-time. I don't know but I doubt "even" the Windows ones can do a more than o.k. job in real-time on a single CPU in real-time. This is especially true if you're trying to do audio compression and multiplexing as well.
Aside: good quality MPEG compression of video requires high quality low-noise sources. The results obtainable from less-than-studio-level analogue sources at high levels of compression may disappoint. If resources won't cover a hardware encoder (KFIR-1 based boards are only a few hundred bucks) you're probably way short in the video source department.