Linux Real Time MPEG Compression?
aszoth asks: "I working on a project that is going to require approximately 4 hours of video recording per day for about two months. We are currently using DVM tapes, however the extraction and compression time has left us with a large library of tapes un-converted. We are considering other methods, in particular real time MPEG 2 or MPEG 4 Compression. We also would like to be able to slow down our frame rate from the 29.7 fps to something along the lines of 5-15 fps. I am wondering if any one has any suggestions on possible ways to do such compression (or get similar results) with a Linux box. Thank you for any help you can give."
Seriously. Do some searching for video capture applications for Linux, and then look at Linux MPEG-4 encoders like Xvid. Then Google can probably also point you towards several how-to guides. Why are you asking Slashdot? Ask Google.
What purpose is this for? is the real time video recording for security? performances? transfer? if it were for security I would say that you could go with just a digital camera taking pictures, rather than a full-on video setup. However, if you really do need video, you should probably go with a capture card like stated above.
Remember, there were no nuclear weapons before women were allowed to vote.
But VirtualDub on a winders box could easily do this, you would simply have to script some stuff, and BAM...done. ..hmm.. while you're at it, you could TRY to port virtualdub to Linux ;)
mpeg4ip should do what you want, if you are willing to ignore the issues with licensing of the MPEG-4 patent portfolio.
If you are not stuck with Linux, I would suggest using a mac - Quick Time Broadcaster does real time mpeg4 encoding at good quality even on old iBooks, and the mpeg-4 royalties are taken of as part of the cost of QuickTime Pro.
You're not very clear on what hardware you have. If you have fast enough hardware you can do software compression in realtime. Use something like transcode or mjpegtools. I used transcode with ffmpeg plugins a few times.
These software packages can do mpeg2, maybe also mpeg4, though I'm not sure of that. They can do xvid and divx, if you're satisfied with that as mpeg4 alternative.
But if it's a lot of data, you need a lot of cpu power. It depends on the resolution and so...
A hardware encoder might suit you better then. Afaik there are only mpeg1 and mpeg2 encoders, even secondhand and cheap. I wonder if there are mpeg4 hardware encoders on the market.
Well, don't worry about that. We can get you back before you leave. (Dr. Who)
MPEG is fine for archiving, but its not that good if you want to edit later. MPEG encodes the difference between key frames. This makes it hard and expensive to edit frame-by-frame.
What I'd like to know is if there are any standard formats that are good for cuts. DV is great, but takes up a lot of space (3 minutes on a CD). It'd be nice to archive easilly editable source, just at a lower-than-dv quality.
Buy a Tivo. It is a linux box after all.
"Eve of Destruction", it's not just for old hippies anymore...
It is Motion JPEG, essentially the same as MPEG inside the frame, but without motion estimation (and resulting frame-to-frame dependance). I've heard that this is what professional video editors use (for the reasons you stated above).
Also, as a shameless plug, a friend of mine builds hardware MJPEG encoder/decoder boards for Linux. Check out http://www.linuxmedialabs.com/
Maybe this is what the original poster needed?
Paul B.
Seriously, get a brand spanking new Mac along with a Formac Studio and at least 80GB of space. I have a friend who captures peoples home movies and puts them on DVD on the side. He got a Mac about a year ago along with a Formac Studio. It can capture at up to 720x480 (DVD quality) and at least stereo if not 5.1 and it transfers it to the mac over firewire. It takes about 15GB/hour for 720x480 with stereo -- uncompressed. So you need a lot of space initially which is why I'd recomend the minimum of an 80GB (120GB would be better of cource). However, if you want standard TV quality and mono, you could probably do it at under 4GB/hour. Then you can edit it and compress it after you're done and then burn it on DVD.
The whole setup will probably hit you about $4000 but it'll be well worth it. The only thing, is that you might have to capture in OS9 because OSX does have some problems once in a while, however the newest 10.2.2 is better I guess (that's what gather from my friend).
At any rate, check out the indie/amature film webpages because most all of them use Macs. Also, if you want to try it on Linux, then if you can afford about $250-$300 for experimentation, I'd pick up a Formac Studio on eBay and try it -- it probably could work since it just outputs DV over firewire but none the less you'll still have the space "problems" I mentioned above.
if you have a dedicated powerhouse (~1.5 GHz+) then you might be able to do Realtime encoding under linux. But many ppl (including myself) have experienced A/V sync problems with FFMPEG...
If you have anything less than a dedicated 2GHz machine, you should seriously look into a hardware encoder.
Canopus makes some cheap mpeg encoder cards, but it looks like the Linux support is sparse...the WinTV PVR-250 is fairly cheap ($150) and supports both MPEG1 & MPEG2 encoding.
So...why bother with something that *MIGHT* work and go with something that is certain to work...
In all fairness, some of the AV sync problems with ffmpeg are most likely due to a difference between the buffer sizes of the video and audio...
As you mentioned, one problem with MPEG is that it's hard to edit frame-by-frame, since one of the primary ways it achieves compression is to compress the difference between each frame, not each individual frame.
Another problem resulting from the interframe dependencies is that if there is too much time between frames (5-15 fps as opposed to the 25+ normally used with MPEG), then the algorithm won't be NEARLY as efficient, since it's tuned around a smaller time interval between frames. (Some other algorithms are tuned around 15ish, like many videoconferencing algorithms. OTOH, a videoconferencing algorithm designed to perform well at 30 FPS will often perform horribly at 15 FPS. This is the case with a codec I worked on at college - It had stunning quality at 30 FPS, but drop it to 15 and it started having serious issues.)
retrorocket.o not found, launch anyway?
ffmpeg. go grab the current cvs sources from sourceforge, if they're back up yet. also if you don't like that interface, you can use the ffmpeg core within mencoder, from the mplayer suite. look it up on freshmeat.
Find an old Iomega Buz on ebay.
They will do realtime MJPEG encoding even on a relatively old machine. And because it is a hardware solution it should be less likely to jitter & choke every now and then.
AND because it is MJPEG and not MPEG like a previous post said it is good for re-editing later.
Malike Bamiyi wanted my assistance.
i work on a similar project and we use mpeg4ip (mpeg4ip.sourceforge.net) to capture input from a tv tuner and compress it in realtime to mpeg4 video and aac audio. there also is a program called 'streamer' that comes with xawtv.
Hostes alienigieni me abduxerunt. Qui annus est?
Darwin/Quicktime Streaming Server will compress live streams and can store them to disk at the same time they are being streamed. How do you think Apple streams its keynotes and then replays them later? The new Powermacs have the ability to compress to MPEG2 in way better than realtime, might as well use that power. Or go Darwin on Intel, and run it on a PC platform. Best of all, it's all free and open source.