real-time encoding of DVB-S @ 900 MHz
Hello there, I can pipe MPEG-2 streams from my Budget DVB-S card directly via cat /dev/dvb/adapter0/dvr0 > stream.ts to a file stream.ts, which can then simultaneously be watched with mplayer, the cat process occupying only few system resources. I could equally well play the stream directly with mplayer at 70% CPU usage, using the dvb://-syntax. That's all really well, but when it comes to recording video, it's got an extreme disadvantage: The raw format produces much too large files. So I clearly need to do some encoding, even scaling the video's size down would be ok, if only I could get the file smaller. I tried all different kinds of video codes (such as MPEG-4 at a bit rate of 40!), but couldn't figure out one sole which resulted in a CPU usage minor than 99%. I perform the decoding task on a Pentium III 900 MHz, so I should at least be able to real-time encode with medium-quality settings, shouldn't I? (With Mythtv I can even both watch and record, so there *must* be a way to achieve encoding with mencoder as well) What settings can you recommend? Thanks a lot indeed, Moritz -- (o_ web http://www.4momo.de //\ mail momo at 4momo dot de V_/_ gpg http://gpg.notlong.com
On Saturday 25 June 2005 21:59, Moritz Beller wrote:
The raw format produces much too large files. So I clearly need to do
It's not raw, it's compressed MPEG2.
(such as MPEG-4 at a bit rate of 40!), but couldn't figure out one sole which resulted in a CPU usage minor than 99%. I perform the decoding task on a Pentium III 900 MHz, so I should at least be able to real-time encode with medium-quality settings, shouldn't I? (With
My Athlon 64 3400+ can encode to xvid/MPEG4 in just over real time under Windows (about 30fps). Under FreeBSD with mencoder I get around 16fps which is well under real time. I'd say you have absolutely no chance on a P3.
Mythtv I can even both watch and record, so there *must* be a way to achieve encoding with mencoder as well)
I imagine it just records the raw MPEG stream. What makes you think it does anything different? -- Cheers, Chris Howells -- chris@chrishowells.co.uk, howells@kde.org Web: http://www.chrishowells.co.uk, PGP ID: 0x33795A2C KDE/Qt/C++/PHP Developer: http://www.kde.org
On Sat, 25 Jun 2005 23:27:55 +0100 Chris Howells <chris+mencoder-users@chrishowells.co.uk> wrote:
I imagine it just records the raw MPEG stream. What makes you think it does anything different?
The quality, actually. Let's have a look at what they state on their website (http://www.mythtv.org/docs/mythtv-HOWTO-3.html#ss3.1):
A PIII/733MHz system can encode one video stream using the MPEG-4 codec using 480x480 capture resolution. This does not allow for live TV watching, but does allow for encoding video and then watching it later.
See also:
A PIII/800MHz system with 512MB RAM can encode one video stream using the RTjpeg codec with 480x480 capture resolution and play it back simultaneously, thereby allowing live TV watching.
I think it's the 480x480 capture resolution that's making the whole difference. I have no clue, though, how to tell mencoder to use 480x480. Moritz -- (o_ web http://www.4momo.de //\ mail momo at 4momo dot de V_/_ gpg http://gpg.notlong.com Gruß Moritz -- (o_ web http://www.4momo.de //\ mail momo at 4momo dot de V_/_ gpg http://gpg.notlong.com
Hi, On Sat, Jun 25, 2005 at 11:27:55PM +0100, Chris Howells wrote:
On Saturday 25 June 2005 21:59, Moritz Beller wrote:
(such as MPEG-4 at a bit rate of 40!), but couldn't figure out one sole which resulted in a CPU usage minor than 99%. I perform the decoding task on a Pentium III 900 MHz, so I should at least be able to real-time encode with medium-quality settings, shouldn't I? (With
My Athlon 64 3400+ can encode to xvid/MPEG4 in just over real time under Windows (about 30fps). Under FreeBSD with mencoder I get around 16fps which is well under real time. I'd say you have absolutely no chance on a P3.
Obviously you're not using options suitable for realtime encoding. I can get about 60 fps with my Athlon 3200, but the files get big then. E.g. with this commandline: mencoder dvd:// -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vqscale=2:keyint=1 -o dvd.avi You of course can't expect to get perfect quality, small files and realtime encode together... Greetings, Reimar Döffinger
On Sun, 26 Jun 2005 12:10:08 +0200 Reimar Döffinger <Reimar.Doeffinger@stud.uni-karlsruhe.de> wrote:
You of course can't expect to get perfect quality, small files and realtime encode together...
Very well said. I experimented the whole day through now and went for these solutions: DVB: RECORDING (1) sudo nice --10 mencoder "dvb://Das Erste" -o Take.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg2video -vf scale=467:350 Makes small, VCD-ready files in reasonably good quality (~7.2MB/M) (2) sudo nice --10 mencoder "dvb://Das Erste" -o test1-mp3.avi -oac mp3lame -lameopts mode=0:cbr:aq=3 -ovc lavc -lavcopts vcodec=mpeg2video -vf scale=384:288 Outputs small, VCD-ready files in acceptable quality, decreasing the filesize even further by encoding the audiostream to MP3 (~7MB/M) (3) sudo nice --10 mencoder dvb://Das Erste -oac mp3lame -lameopts mode=0:cbr:aq=3 -ovc lavc -lavcopts vcodec=mpeg4:vqscale=2:keyint=1 -vf scale=384:288 -o test.avi Produces high-quality, yet very big files (~40MB/M) You'll probably want (1) and (2) for every day usage. (3) is needed in such cases when you want to go for very good quality, but leaving the deinterlacing out (directly copying the MPEG2-stream would need this). regards, Moritz -- (o_ web http://www.4momo.de //\ mail momo at 4momo dot de V_/_ gpg http://gpg.notlong.com
Moritz Beller wrote:
On Sun, 26 Jun 2005 12:10:08 +0200 Reimar Döffinger <Reimar.Doeffinger@stud.uni-karlsruhe.de> wrote:
You of course can't expect to get perfect quality, small files and realtime encode together...
Very well said.
I experimented the whole day through now and went for these solutions:
DVB: RECORDING
(1) sudo nice --10 mencoder "dvb://Das Erste" -o Take.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg2video -vf scale=467:350
you should never encode to resolutions that aren't integer multiples of 16. Besides, you are storing mpeg2 in avi. Are you sure you don't want it stored in mpeg? Why don't you add at least mbd=2 ?
Makes small, VCD-ready files in reasonably good quality (~7.2MB/M)
(2) sudo nice --10 mencoder "dvb://Das Erste" -o test1-mp3.avi -oac mp3lame -lameopts mode=0:cbr:aq=3 -ovc lavc -lavcopts vcodec=mpeg2video -vf scale=384:288
Outputs small, VCD-ready files in acceptable quality, decreasing the filesize even further by encoding the audiostream to MP3 (~7MB/M)
(3) sudo nice --10 mencoder dvb://Das Erste -oac mp3lame -lameopts mode=0:cbr:aq=3 -ovc lavc -lavcopts vcodec=mpeg4:vqscale=2:keyint=1 -vf scale=384:288 -o test.avi
Produces high-quality, yet very big files (~40MB/M)
Hi, On Sun, Jun 26, 2005 at 06:29:25PM +0200, Moritz Beller wrote:
(3) sudo nice --10 mencoder dvb://Das Erste -oac mp3lame -lameopts mode=0:cbr:aq=3 -ovc lavc -lavcopts vcodec=mpeg4:vqscale=2:keyint=1 -vf scale=384:288 -o test.avi
Produces high-quality, yet very big files (~40MB/M)
You'll probably want (1) and (2) for every day usage. (3) is needed in such cases when you want to go for very good quality, but leaving the deinterlacing out (directly copying the MPEG2-stream would need this).
Well, that example was for how to get very high speed, you might very well adjust the qscale/keyint, that's really something everyone has to try out themselves. I really is my impression that mpeg4 is almost always better than mpeg2, you just need to find the right options. Also if input is interlaced, you can use intelaced compression, see the ilme and ildct lavc options (I hope they also work for mpeg4). Greetings, Reimar Döffinger
Moritz Beller wrote:
Hello there,
I can pipe MPEG-2 streams from my Budget DVB-S card directly via
cat /dev/dvb/adapter0/dvr0 > stream.ts
to a file stream.ts, which can then simultaneously be watched with mplayer, the cat process occupying only few system resources. I could equally well play the stream directly with mplayer at 70% CPU usage, using the dvb://-syntax. That's all really well, but when it comes to recording video, it's got an extreme disadvantage:
The raw format produces much too large files. So I clearly need to do some encoding, even scaling the video's size down would be ok, if only I could get the file smaller. I tried all different kinds of video codes (such as MPEG-4 at a bit rate of 40!), but couldn't figure out one sole which resulted in a CPU usage minor than 99%. I perform the decoding task on a Pentium III 900 MHz, so I should at least be able to real-time encode with medium-quality settings, shouldn't I? (With Mythtv I can even both watch and record, so there *must* be a way to achieve encoding with mencoder as well)
What settings can you recommend?
Thanks a lot indeed,
I use this: mencoder -ffourcc XVID -mc 0.01 dvb:// -o recording.avi -ac ffmp2, -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:v4mv:vbitrate=800:vmax_b_frames=0:keyint=25:sc_threshold=-1000:qprd -sws 2 -oac mp3lame -lameopts cbr:br=128 -vf scale=512:384 $EXTRA and don't lose frames. I still have power enough to compile mplayer, in the meantime, at least with my P4 2.6. Nico
participants (4)
-
Chris Howells -
Moritz Beller -
Nico Sabbi -
Reimar Döffinger