title: Amazon AWS Kinesis Video Boto GetMedia/PutMedia
body: <p>Does anybody know of a complete sample as to how to send video to a kinesis video stream, using boto3 sdk? </p>
  
  <p>This question was asked initially for both both GetMedia and PutMedia. Now I have got this sample code for the GetMedia part: </p>
  
  <pre><code>client = boto3.client('kinesisvideo')
  response = client.get_data_endpoint(
      StreamName='my-test-stream',
      APIName='GET_MEDIA'
  )
  print(response)
  endpoint = response.get('DataEndpoint', None)
  print("endpoint %s" % endpoint)
  
  if endpoint is not None:
      client2 = boto3.client('kinesis-video-media', endpoint_url=endpoint)
      response = client2.get_media(
          StreamName='my-test-stream',
          StartSelector={
              'StartSelectorType': 'EARLIEST',
          }
      )
      print(response)
  
      stream = response['Payload'] # botocore.response.StreamingBody object
      while True:
              ret, frame = stream.read()
              print(" stream type ret %s frame %s" % (type(ret), type(frame)))
  </code></pre>
  
  <p>How do you to the PutMedia? From a previous post "<a href="https://stackoverflow.com/questions/49713393/amazon-kinesis-video-getmedia-putmedia">Amazon Kinesis Video GetMedia/PutMedia</a>", it looks like you have to construct your own url request for a PutMedia. Is that the case? If it is, can someone share a complete sample?</p>