Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This is not specific ubuntu/linux question but I hope someone can help me.

I am doing some video stream server which on slow PC (CPU 1GHz, bad GPU (via)). Does someone knows which codec should I use?

The source is 720x576 YUV (PAL) which is too big to stream directly (took all 100Mbit LAN bandwidth). I want to get stream caa 200kB/s so it would be suitable also over internet.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

I found solution that runs quite well.

This solution uses VLC for all work. Video is captured from USB Webcam, compressed and served to web. Stream is HTML 5 compatible, so it can be used for streaming.

This solution is using VLC for whole process:

vlc -v v4l2:///dev/video0:width=320:height=240 --v4l2-chroma=UYVY --v4l2-fps=5 --sout "#transcode{vcodec=theo,vb=256,scale=1,acodec=none,fps=25}:standard{access=http,mux=ogg,dst=:8081/stream.ogg}"

I did tests with Intel Atom D525. Cpu usage is around 20% and network transfer is 60kB/s

To playback video you just need to open browser that supports html5 ogg (Firefox) on address:

  • http://localhost:8081/stream.ogg

or another VLC

  • vlc http://localhost:8081/stream.ogg ----network-caching=100

If you wish to get better image you can change

  • vb=1024 Just do some testings. (bit (not byte) per second)
  • width=640:height=480. Check webcam's available resolutions

There are many things that you need to check if your CPU is too high. Your camera needs natively support chosen resolution and color space. Any conversion on CPU is slow! Try choosing other --v4l2-chroma=UYVY (UYVY, YUY2, RV24, RV32, MJPEG, ...).

To check what are cameras capabilities, you can use program guvcview. It can be installed trough Software Center.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.