Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Unix Operating Systems Software

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."
This discussion has been archived. No new comments can be posted.

Realtime Software MPEG2 Encoding Under Unix?

Comments Filter:
  • I have looked and I centainly cant find anything for this

    hardware is the only way to go

    sorry

    john jones
  • Real time software mpeg2 encoding can't be done with all of the following three components at the present time: good picture quality, fast frame rate, good compression. The CODEC is just too math intensive for present processors. There are consumer MPEG2 encoding boards but as far as I know none of these have Linux support. The Hauppauge WinTV PVR is one such card, and retails for around $230.

    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.

  • I realize that this is not what you asked for, but maybe check out vcr [stack.nl]. It'll do real-time divx encoding, as well as mpeg-4..it works great for me...I record 320x240@30fps and it looks great (on a dual 400 celeron with 256MB RAM..it only uses one processor though) I then use aviplay to watch the movie, and it scales up very cleanly to 1280x1024, very clear picture, and only uses about 10% CPU during playback.

    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)
  • Check out Pinnacle's Studio DC10+ [pinnaclesys.com] for (US) $100. Hardware based MPEG and there's a linux driver [cicese.mx] available (which I have not used yet).

    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.
  • The DC10+ does not do MPEG in any way, shape, or form. It does Motion JPEG, which is basically a stream of JPEG images for each picture field (there is no temporal compression, each field is independent of the others).
  • I've used the DC30+, and I'm assuming the DC10+ is similar, extensively, and you are indeed correct. It uses MJPEG and not true MPEG.

    MJPEG is hardly comparable to MPEG.
    Although, it might work for this specific application..
  • by Anonymous Coward
    There are a few programs doing real time MPEG compression right now. For a list of video compression programs visit Related Projects on LinuxVideo [linuxvideo.org].

    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.

    --
    Arnd Bergmann <arnd at itreff dot de>, no /. login

  • Depends on what you're doing. If the original poster just needs high-quality recording and playback (possibly with editing), then it'll do fine. (I usually use mine at approx. 3.6MB/s data rate with pleasing results.) If they actually need MPEG-2 as requested, it won't help. However it's unclear from the post what the actual requirements are.

    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)
  • I've been checking out video conferencing software for linux, and found qVIX [sourceforge.net] by some Cornell dudes. Apparently does 30fps over low bandwidth and much better quality than Netscape's thing.
  • Real-time DVD profile MPEG-2 compression is undoubtedly possible. mp1e is nice example of what can be done if speed is your primary goal. Even the MPEG encoder I'm working on (main emphasis on quality not speed) http://mjpeg.sourceforge.net will happily do real-time VCD MPEG-1 at decent quality. The latest multi-thread patches would put SVCD within reach of high-end dual CPU machines.


    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.

"God is a comedian playing to an audience too afraid to laugh." - Voltaire

Working...