Navigation

    Home
    All Categories
    • KEEN Trail Camera
    • Top #ReolinkCaptures Awards
    • Announcements and News
    • Wishlist
    • #ReolinkTrial
    • Discussion About Products
    • Reolink Captures
    • Reolink Client & APP
    #ReolinkTrial
    Reolink Captures
    Log in to post
    Guest
    • Guest
    • Register
    • Login

    Learn More

    Reolink updates Learn More

    Meet Reolink at IFA 2024! Learn More

    Reolink Q&A Learn More

    Switch resolution via API

    Reolink Client & APP
    resolution
    3
    16
    1323
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • das-dos_208145718501556
      das-dos last edited by

      Hi!
      I have a RLC-823A 16x and would like to change the resolution of the cam via API call (curl comand within linux script)
      The API I am already using for making snapshots, but I do not know the API command for a resolution change.
      Is this possible?


      Reply Quote
      Share
      • Share this Post
      • Facebook
      • Twitter
      • copy the link
        Copied!
      0
        • Reolink Lorenz
          Lorenz @das-dos last edited by

          @das-dos_208145718501556 Hello there, you can switch resolution via API command listed below. Note that with camera resolution changed, the camera will restart and work again after restart.

          [{
              "cmd": "SetEnc",
              "action": 0,
              "param": {
                  "Enc": {
                      "audio": 0,
                      "channel": 0,
                      "mainStream": {
                          "size": "2560*1920"
                      },
                      "subStream": {
                          "size": "640*480"
                      }
                  }
              }
          }]

          Reply Quote
          Share
          • Share this Post
          • Facebook
          • Twitter
          • copy the link
            Copied!
          0
          • joseph_1979
            Joseph Global Moderator @das-dos last edited by

            @das-dos_208145718501556 According the API v8 the following parameters are mandatory in command SetEnc.

            undefined


            And so the curl command should be as follows.

            curl -s -k -X POST -H "Content-Type : application/json" -d "[{\"cmd": \"SetEnc\",\"action\": 0,\"param\": {\"Enc\": {\"channel\": 0,\"audio\": 1,\"mainStream\": {\"size\": \"2560*1920\",\"frameRate\": 20,\"bitRate\": 4096,\"profile\": \"High\"},\"subStream\": {\"size\": \"640*480\",\"frameRate\": 10,\"bitRate\": 256,\"profile\": \"High\"}}}" "https://#IP#/cgi-bin/api.cgi?cmd=SetEnc&user=#username#&password=#passwd#"

            Please replace the IP with the cam IP and the username and passwd with your credentials.

            And if it doesn't reboot you can reboot it using

            curl -s -k -X POST -H "Content-Type : application/json" -d "[{\"cmd\":\"Reboot\",\"action\":0,\"param\":{}}]" "https://#IP#/cgi-bin/api.cgi?cmd=Reboot&user=#username#&password=#passwd#"

            Reply Quote
            Share
            • Share this Post
            • Facebook
            • Twitter
            • copy the link
              Copied!
            1
            • das-dos_208145718501556
              das-dos @Joseph last edited by

              @joseph_1979 HI! Thanks for this response. The curl code for reboot is working fine. But the modification of the resolution unfortunately is not working. Maybe there is a syntax error within the code?

              Reply Quote
              Share
              • Share this Post
              • Facebook
              • Twitter
              • copy the link
                Copied!
              0
              • joseph_1979
                Joseph Global Moderator @das-dos last edited by joseph_1979

                @das-dos_208145718501556 ha haha I did that purposely for you to fix and I replied when I was having a bottle of fine wine with my friends...........Joking. I missed an escape character \. Try now. Replace the size, frame rate and bitrate with the appropriate values given in the stream menu. just follow the command in the API v8 doc provided by Reolink.

                curl -s -k -X POST -H "Content-Type : application/json" -d "[{\"cmd\": \"SetEnc\",\"action\": 0,\"param\": {\"Enc\": {\"channel\": 0,\"audio\": 1,\"mainStream\": {\"size\": \"2560*1920\",\"frameRate\": 20,\"bitRate\": 4096,\"profile\": \"High\"},\"subStream\": {\"size\": \"640*480\",\"frameRate\": 10,\"bitRate\": 256,\"profile\": \"High\"}}}" "https://#IP#/cgi-bin/api.cgi?cmd=SetEnc&user=#username#&password=#passwd#"

                Reply Quote
                Share
                • Share this Post
                • Facebook
                • Twitter
                • copy the link
                  Copied!
                0
                • das-dos_208145718501556
                  das-dos @Joseph last edited by das-dos_208145718501556

                  @joseph_1979 Hi Joseph, without a fine wine I am not able to make a clear thought at all 😉

                  When trying your corrected code it seems to occur a problem with the authentification ("...Please login first...:"):



                  But I am 100% sure I am using my correct login data as the reboot code is working fine.

                  Any ideas?

                  P.S.: Many thanks Joseph for your kind assistance! That´s highly appreciated!

                  Reply Quote
                  Share
                  • Share this Post
                  • Facebook
                  • Twitter
                  • copy the link
                    Copied!
                  0
                  • das-dos_208145718501556
                    das-dos @das-dos last edited by

                    @das-dos_208145718501556 by the way I am running this on a linux maschine if of importance

                    Reply Quote
                    Share
                    • Share this Post
                    • Facebook
                    • Twitter
                    • copy the link
                      Copied!
                    0
                    • joseph_1979
                      Joseph Global Moderator @das-dos last edited by joseph_1979

                      @das-dos_208145718501556 They should improve the API by adding appropriate error codes and update the API doc if there are changes. The error indicates that we have a missing parameter. So we need to get the printout first. Maybe we need to add gop.

                      Send this to get what need to be included. You should get the initial (default) and the one set (Value)

                      curl -s -k -X POST -H "Content-Type : application/json" -d "[{ \"cmd\":\"GetEnc\", \"action\":1, \"param\":{ \"channel\":0}}]" "https://#IP#/cgi-bin/api.cgi?cmd=GetEnc&user=#username#&password=#passwd#

                      Don't worry about the private IP 172.16. 0.0 to 172.31. 255.255 (class B)....nobody will be able to access this IP from the Internet side.


                      Reply Quote
                      Share
                      • Share this Post
                      • Facebook
                      • Twitter
                      • copy the link
                        Copied!
                      0
                      • joseph_1979
                        Joseph Global Moderator @das-dos last edited by joseph_1979

                        @das-dos_208145718501556 It's more simpler and robust. I do have a number of Linux machines G10 in VM/OpenStack.........but no MAC/IOS :).

                        Reply Quote
                        Share
                        • Share this Post
                        • Facebook
                        • Twitter
                        • copy the link
                          Copied!
                        0
                        • das-dos_208145718501556
                          das-dos @Joseph last edited by

                          @joseph_1979 Here come the output of this command:

                          [
                            {
                             "cmd" : "GetEnc",
                             "code" : 0,
                             "initial" : {
                               "Enc" : {
                                "audio" : 0,
                                "channel" : 0,
                                "mainStream" : {
                                  "bitRate" : 6144,
                                  "frameRate" : 25,
                                  "gop" : 2,
                                  "height" : 2160,
                                  "profile" : "High",
                                  "size" : "3840*2160",
                                  "vType" : "h265",
                                  "width" : 3840
                                },
                                "subStream" : {
                                  "bitRate" : 256,
                                  "frameRate" : 10,
                                  "gop" : 4,
                                  "height" : 360,
                                  "profile" : "High",
                                  "size" : "640*360",
                                  "vType" : "h264",
                                  "width" : 640
                                }
                               }
                             },
                             "range" : {
                               "Enc" : [
                                {
                                  "audio" : "boolean",
                                  "chnBit" : 1,
                                  "mainStream" : {
                                   "bitRate" : [ 4096, 5120, 6144, 7168, 8192 ],
                                   "default" : {
                                     "bitRate" : 6144,
                                     "frameRate" : 25,
                                     "gop" : 2
                                   },
                                   "frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
                                   "gop" : {
                                     "max" : 2,
                                     "min" : 1
                                   },
                                   "height" : 2160,
                                   "profile" : [ "Base", "Main", "High" ],
                                   "size" : "3840*2160",
                                   "vType" : "h265",
                                   "width" : 3840
                                  },
                                  "subStream" : {
                                   "bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
                                   "default" : {
                                     "bitRate" : 256,
                                     "frameRate" : 10,
                                     "gop" : 4
                                   },
                                   "frameRate" : [ 15, 10, 7, 4 ],
                                   "gop" : {
                                     "max" : 4,
                                     "min" : 1
                                   },
                                   "height" : 360,
                                   "profile" : [ "Base", "Main", "High" ],
                                   "size" : "640*360",
                                   "vType" : "h264",
                                   "width" : 640
                                  }
                                },
                                {
                                  "audio" : "boolean",
                                  "chnBit" : 1,
                                  "mainStream" : {
                                   "bitRate" : [ 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168, 8192 ],
                                   "default" : {
                                     "bitRate" : 6144,
                                     "frameRate" : 25,
                                     "gop" : 2
                                   },
                                   "frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
                                   "gop" : {
                                     "max" : 2,
                                     "min" : 1
                                   },
                                   "height" : 1440,
                                   "profile" : [ "Base", "Main", "High" ],
                                   "size" : "2560*1440",
                                   "vType" : "h264",
                                   "width" : 2560
                                  },
                                  "subStream" : {
                                   "bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
                                   "default" : {
                                     "bitRate" : 256,
                                     "frameRate" : 10,
                                     "gop" : 4
                                   },
                                   "frameRate" : [ 15, 10, 7, 4 ],
                                   "gop" : {
                                     "max" : 4,
                                     "min" : 1
                                   },
                                   "height" : 360,
                                   "profile" : [ "Base", "Main", "High" ],
                                   "size" : "640*360",
                                   "vType" : "h264",
                                   "width" : 640
                                  }
                                },
                                {
                                  "audio" : "boolean",
                                  "chnBit" : 1,
                                  "mainStream" : {
                                   "bitRate" : [ 1024, 1536, 2048, 3072, 4096, 5120, 6144, 7168, 8192 ],
                                   "default" : {
                                     "bitRate" : 6144,
                                     "frameRate" : 25,
                                     "gop" : 2
                                   },
                                   "frameRate" : [ 25, 22, 20, 18, 16, 15, 12, 10, 8, 6, 4, 2 ],
                                   "gop" : {
                                     "max" : 2,
                                     "min" : 1
                                   },
                                   "height" : 1296,
                                   "profile" : [ "Base", "Main", "High" ],
                                   "size" : "2304*1296",
                                   "vType" : "h264",
                                   "width" : 2304
                                  },
                                  "subStream" : {
                                   "bitRate" : [ 64, 128, 160, 192, 256, 384, 512 ],
                                   "default" : {
                                     "bitRate" : 256,
                                     "frameRate" : 10,
                                     "gop" : 4
                                   },
                                   "frameRate" : [ 15, 10, 7, 4 ],
                                   "gop" : {
                                     "max" : 4,
                                     "min" : 1
                                   },
                                   "height" : 360,
                                   "profile" : [ "Base", "Main", "High" ],
                                   "size" : "640*360",
                                   "vType" : "h264",
                                   "width" : 640
                                  }
                                }
                               ]
                             },
                             "value" : {
                               "Enc" : {
                                "audio" : 0,
                                "channel" : 0,
                                "mainStream" : {
                                  "bitRate" : 4096,
                                  "frameRate" : 25,
                                  "gop" : 2,
                                  "height" : 1440,
                                  "profile" : "High",
                                  "size" : "2560*1440",
                                  "vType" : "h264",
                                  "width" : 2560
                                },
                                "subStream" : {
                                  "bitRate" : 256,
                                  "frameRate" : 10,
                                  "gop" : 4,
                                  "height" : 360,
                                  "profile" : "High",
                                  "size" : "640*360",
                                  "vType" : "h264",
                                  "width" : 640
                                }
                               }
                             }
                            }
                          ]

                          Reply Quote
                          Share
                          • Share this Post
                          • Facebook
                          • Twitter
                          • copy the link
                            Copied!
                          0
                          • joseph_1979
                            Joseph Global Moderator @das-dos last edited by joseph_1979

                            @das-dos_208145718501556 Only the Initial was enough to know what is missing. So we need to add the I-Frame interval parameter gop.

                            Check again :).

                            curl -s -k -X POST -H "Content-Type : application/json" -d "[{\"cmd": \"SetEnc\",\"action\": 0,\"param\": {\"Enc\": {\"channel\": 0,\"audio\": 1,\"mainStream\": {\"size\": \"3840*2160\",\"frameRate\": 25,\"bitRate\": 8192,\"gop\": 2,\"profile\": \"High\"},\"subStream\": {\"size\": \"640*360\",\"frameRate\": 15,\"bitRate\": 512,\"gop\": 4,\"profile\": \"High\"}}}" "https://192.168.X.X/cgi-bin/api.cgi?cmd=SetEnc&user=#username#&password=#passwd#"

                            BTW what's the model?

                            Reply Quote
                            Share
                            • Share this Post
                            • Facebook
                            • Twitter
                            • copy the link
                              Copied!
                            0
                            • das-dos_208145718501556
                              das-dos @Joseph last edited by

                              @joseph_1979 Thanks Joseph.

                              Copy/Paste your code (and changing IP, user and pw of course) does not work. Prompt is not coming back.
                              I slightly changed using ChatGPT into the following as ChatGPT said there is a wrong use of " and }:

                              curl -s -k -X POST -H "Content-Type : application/json" -d "[{\"cmd": \"SetEnc\",\"action\": 0,\"param\": {\"Enc\": {\"channel\": 0,\"audio\": 1,\"mainStream\": {\"size\": \"3840*2160\",\"frameRate\": 25,\"bitRate\": 8192,\"gop\": 2,\"profile\": \"High\"},\"subStream\": {\"size\": \"640*360\",\"frameRate\": 15,\"bitRate\": 512,\"gop\": 4,\"profile\": \"High\"}}}" "https://#ip#/cgi-bin/api.cgi?cmd=SetEnc&user=#user#&password=#pw#"

                              But using this code I receive the "login first" prob again:

                              [
                                {
                                 "cmd" : "SetEnc",
                                 "code" : 1,
                                 "error" : {
                                   "detail" : "please login first",
                                   "rspCode" : -6
                                 }
                                }
                              ]

                              I have a RLC-823A 16X.

                              Reply Quote
                              Share
                              • Share this Post
                              • Facebook
                              • Twitter
                              • copy the link
                                Copied!
                              0
                              • joseph_1979
                                Joseph Global Moderator @das-dos last edited by

                                @das-dos_208145718501556 Oops sorry to hear that it didn't work. Let me check it on my camera.

                                Reply Quote
                                Share
                                • Share this Post
                                • Facebook
                                • Twitter
                                • copy the link
                                  Copied!
                                0
                                • joseph_1979
                                  Joseph Global Moderator @Joseph last edited by joseph_1979

                                  @joseph_1979 Typing error.

                                  Here it comes.

                                  curl -s -k -X POST -H "Content-Type : application/json" -d "[{\"cmd\":\"SetEnc\",\"action\":0,\"param\":{\"Enc\":{\"channel\":0,\"audio\":1,\"mainStream\":{\"size\":\"3840*2160\",\"frameRate\":25,\"bitRate\":8192,\"gop\":2,\"profile\":\"High\"},\"subStream\":{\"size\":\"640*360\",\"frameRate\":10,\"bitRate\":512,\"gop\":4,\"profile\":\"High\"}}}}]" "https://192.168.X.X/cgi-bin/api.cgi?cmd=SetEnc&user=#username#&password=#passwd#"

                                  If it works then I am better than chatgbt :). Don't forget to reboot after.

                                  Reply Quote
                                  Share
                                  • Share this Post
                                  • Facebook
                                  • Twitter
                                  • copy the link
                                    Copied!
                                  0
                                  • das-dos_208145718501556
                                    das-dos @Joseph last edited by

                                    @joseph_1979 wwwoow! That´s it, it´s working perfect! By the way: The reboot is initiated automatically by the webcam.
                                    Many many thanks for your support Joseph! And as you say: ChatGPT is not on your level 🙂

                                    Reply Quote
                                    Share
                                    • Share this Post
                                    • Facebook
                                    • Twitter
                                    • copy the link
                                      Copied!
                                    0
                                    • joseph_1979
                                      Joseph Global Moderator @das-dos last edited by

                                      @das-dos_208145718501556 You're welcome. Enjoy programming....it is unbelievable fun in particular C++.

                                      Reply Quote
                                      Share
                                      • Share this Post
                                      • Facebook
                                      • Twitter
                                      • copy the link
                                        Copied!
                                      0
                                      View 13 replies
                                    • First post
                                      Last post
                                    All Categories
                                    Announcements and News Reolink Client & APP Discussion About Products #ReolinkTrial Reolink Captures Wishlist KEEN Trail Camera
                                    Never miss Reolink hot deals, news, and updates tailored for you.

                                    Thanks for your subscription!

                                    Please enter a valid email address.

                                    Oops… Something went wrong. Please try again later.

                                    You are already subscribed to this email list. :)

                                    Submission failed. Please try again later.

                                    Reolink Store|Support|About Us|Privacy Policy|Terms and Conditions

                                    Copyright 2025 © Reolink All Rights Reserved.

                                    Welcome Back!

                                    Hi there! Join the Commnunity to get all the latest news, tips and more!

                                    Join Now