AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

The rotation of ip camera

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

The rotation of ip camera

Postby phiphophe » Wed Dec 19, 2018 3:12 pm

I'm having trouble rotating the IP camera. When I request the URL_LEFT(http://113.160.215.79:8083/cgi-bin/view ... ?move=left) the system repeatedly calls httprequest causing it to rotate continuously to the left. I tried redirecting the URL (http://113.160.215.79:8083/video.mjpg?) but my way is not good because I put URL (image) after URL (left), it's not working. Probably command 1 is not finished yet then command 2 has arrived. please my English
Please help me, any ideas are welcome
my code:
Code: Select all
          //method 1
         _videoSource = new MJPEGStream(http://113.160.215.79:8083/cgi-bin/viewer/camctrl.cgi?move=left);
            _videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
            _videoSource.Start();
            //method 2
           _videoSource = new MJPEGStream(http://113.160.215.79:8083/video.mjpg?);
            _videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
            _videoSource.Start();
           it's not working :(
phiphophe
 
Posts: 5
Joined: Wed Dec 19, 2018 2:07 pm

Re: The rotation of ip camera

Postby andrew.kirillov » Wed Dec 19, 2018 5:53 pm

It looks like you need to call URL_LEFT only once, not in a loop. MJPEGStream is designed to get images from IP camera, not control it. You have to use other API (standard .NET classes will do fine), to invoke camera control commands.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3383
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: The rotation of ip camera

Postby phiphophe » Thu Dec 20, 2018 7:11 am

andrew.kirillov wrote:It looks like you need to call URL_LEFT only once, not in a loop. MJPEGStream is designed to get images from IP camera, not control it. You have to use other API (standard .NET classes will do fine), to invoke camera control commands.

Thank you for the answer. The short answer but it helped me a lot. I think I'm out of a few ways. I will share for everyone if I succeed so many people do not have to ask again. Onêc again, Thank you so much andrew.kirillov sir.
phiphophe
 
Posts: 5
Joined: Wed Dec 19, 2018 2:07 pm

Re: The rotation of ip camera

Postby phiphophe » Fri Dec 21, 2018 3:39 am

andrew.kirillov wrote:It looks like you need to call URL_LEFT only once, not in a loop. MJPEGStream is designed to get images from IP camera, not control it. You have to use other API (standard .NET classes will do fine), to invoke camera control commands.

I have done it. The problem is more monotonous than I am thinking, I just need to call "get httprequest".
Code: Select all
HttpRequest httpClient;
        public MainWindow()
        {
            InitializeComponent();
            httpClient = new HttpRequest();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string url = "http://113.161.194.216:89/nphControlCamera?Direction=PanRight";
            string html = Get(url);
            result.Text = html;
        }

        private string Get(string address)
        {
            string resulttext;
           resulttext = httpClient.Get(address).ToString();
            return resulttext;
        }
    }
Last edited by phiphophe on Sat Dec 22, 2018 4:03 am, edited 1 time in total.
phiphophe
 
Posts: 5
Joined: Wed Dec 19, 2018 2:07 pm

Re: The rotation of ip camera

Postby andrew.kirillov » Fri Dec 21, 2018 7:48 am

Well done.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3383
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to AForge.NET Framework