Difference between revisions of "Using Mplayer With Video API"

From ElphelWiki
Jump to: navigation, search
 
Line 1: Line 1:
 
{{en|ru=Using_Mplayer_With_Video_API.Ru|cn=Using_Mplayer_With_Video_API.cn}}
 
{{en|ru=Using_Mplayer_With_Video_API.Ru|cn=Using_Mplayer_With_Video_API.cn}}
  
Video API позволяет принимать видеопоток как по HTTP, так и RTP/UDP. Нужно сказать, что в отличии от камер Axis камеры Elphel по RTP могут принимать поток MJPG или Theora.
+
Video API allow to obtain the video stream by HTTP and RTP/UDP. In difference from the Axis cameras, the Elphel cameras can obtain the MJPG stream or Theora stream by the RTP protocol.
  
 
==HTTP==
 
==HTTP==
Пример команды получающей поток в формате MPJPG с камеры (Elphel, Axis etc) :
+
It's example of command for MPJPG format stream obtaining from camera (Elphel, Axis etc):
 
  <nowiki>$mplayer -fps 6 -demuxer lavf http://192.168.0.9/mjpg/video.mjpg</nowiki>
 
  <nowiki>$mplayer -fps 6 -demuxer lavf http://192.168.0.9/mjpg/video.mjpg</nowiki>
  
Если нужно принять поток с произвольными параметрами, то нужно идти на небольшую хитрость. Дело в том, что '''lavf''' воспринимает поток как MPJPG, только если в конце имени файла или URL стоит расширение ".mjpg". Поэтому к URL нужно добавить фиктивный параметр c расширением ".mjpg", например так :
+
If you want to obtain the stream with the non-specify parameters, the small trick is necessary. In fact, the '''lavf''' obtain the stream as MPJPG when the file name or URL have extension ".mjpg" at the end. Therefore to URL it is necessary to add the fictitious parameter with extension ".mjpg", for example:
 
  <nowiki>$mplayer -fps 6 -demuxer lavf http://192.168.0.9/axis-cgi/mjpg/video.cgi?resolution=1024x768&bogus.mjpg</nowiki>
 
  <nowiki>$mplayer -fps 6 -demuxer lavf http://192.168.0.9/axis-cgi/mjpg/video.cgi?resolution=1024x768&bogus.mjpg</nowiki>
  
mplayer может также воспроизводить файлы, с сохраненным MJPG потоком. Например, поток был сохранен таким образом :
+
Also MPlayer can play the files which is the recorded MJPG stream. For example, the stream was saved by this way:
 
  <nowiki>$wget http://192.16.0.9/axis-cgi/mjpg/video.cgi?resolution=1024x768 -O video.mjpg</nowiki>
 
  <nowiki>$wget http://192.16.0.9/axis-cgi/mjpg/video.cgi?resolution=1024x768 -O video.mjpg</nowiki>
и fps был равен 6, то можно это файл воспроизвести так :
+
with fps value 6, you can play this file by the next way:
 
  <nowiki>$mplayer -fps 6 -demuxer lavf video.mjpg</nowiki>
 
  <nowiki>$mplayer -fps 6 -demuxer lavf video.mjpg</nowiki>
  
Line 18: Line 18:
 
===MJPG===
 
===MJPG===
 
====Multicast====
 
====Multicast====
В стандартном Axis Video API нет возможности получить multicast поток по RTSP. Но есть возможность получения SDP-файла и на основе его принять поток.
+
In standard Axis Video API there is no possibility for obtaining multicast stream by RTSP. But there is possibility for SDP-file obtaining and obtain stream on the SDP base.
  
Получить SDP-файл можно по адресу : <nowiki>http://192.168.0.9/mjpg/media.sdp</nowiki>
+
You can obtain the SDP-file from address:
  
После этого можно воспроизвести поток :
+
<nowiki>http://192.168.0.9/mjpg/media.sdp</nowiki>
 +
 
 +
After that you can play stream:
  
 
  <nowiki>$mplayer sdp://media.sdp</nowiki>
 
  <nowiki>$mplayer sdp://media.sdp</nowiki>
  
или сохранить в файл :
+
or save into the file:
 
  <nowiki>$mencoder -fps 2 sdp://media.sdp -ovc copy -o my.avi</nowiki>  
 
  <nowiki>$mencoder -fps 2 sdp://media.sdp -ovc copy -o my.avi</nowiki>  
К сожалению mencoder требует для правильной работы указания fps, хотя в sdp-файле этот параметр присутствует.
+
 
 +
Unfortunately, you must specify the fps for correctness of mencoder work, although in sdp-file this parameter is present.
  
 
====Unicast====
 
====Unicast====
Можно обратиться по протоколу RTSP к RTSP-серверу в камере и получить unicast видео-поток.  
+
It is possible to address to camera's RTSP-server by using the RTSP-protocol and obtain the unicast video stream.
  
 
===Theora===
 
===Theora===

Revision as of 13:55, 24 December 2005

in English | [[{{{de}}}|deutsch]] | [[{{{fr}}}|français]] | по-русски | автоперевод | 中文版 | 机械翻译


Video API allow to obtain the video stream by HTTP and RTP/UDP. In difference from the Axis cameras, the Elphel cameras can obtain the MJPG stream or Theora stream by the RTP protocol.

HTTP

It's example of command for MPJPG format stream obtaining from camera (Elphel, Axis etc):

$mplayer -fps 6 -demuxer lavf http://192.168.0.9/mjpg/video.mjpg

If you want to obtain the stream with the non-specify parameters, the small trick is necessary. In fact, the lavf obtain the stream as MPJPG when the file name or URL have extension ".mjpg" at the end. Therefore to URL it is necessary to add the fictitious parameter with extension ".mjpg", for example:

$mplayer -fps 6 -demuxer lavf http://192.168.0.9/axis-cgi/mjpg/video.cgi?resolution=1024x768&bogus.mjpg

Also MPlayer can play the files which is the recorded MJPG stream. For example, the stream was saved by this way:

$wget http://192.16.0.9/axis-cgi/mjpg/video.cgi?resolution=1024x768 -O video.mjpg

with fps value 6, you can play this file by the next way:

$mplayer -fps 6 -demuxer lavf video.mjpg

RTP

MJPG

Multicast

In standard Axis Video API there is no possibility for obtaining multicast stream by RTSP. But there is possibility for SDP-file obtaining and obtain stream on the SDP base.

You can obtain the SDP-file from address:

http://192.168.0.9/mjpg/media.sdp

After that you can play stream:

$mplayer sdp://media.sdp

or save into the file:

$mencoder -fps 2 sdp://media.sdp -ovc copy -o my.avi 

Unfortunately, you must specify the fps for correctness of mencoder work, although in sdp-file this parameter is present.

Unicast

It is possible to address to camera's RTSP-server by using the RTSP-protocol and obtain the unicast video stream.

Theora