Issue in playing camera stream through RTMP encoder

vamsi

New Member
Hi,

I have converted the rtsp stream of my IP camera to flashphoner rtmp encoder using FFmpeg. I am pushing the camera stream from my on premise server to WCS. FFMPEG can push the stream to RTMP endpoint.
Screenshot_from_2020_05_26_18_27_02.png


When I try to play the live stream from demo player. It shows status as "Playing" but the player stays blank. I stopped the player and started again. Now I can see the camera in the demo player. But after few seconds it stops playing.
In the flashphoner logs I can see this error.

Screenshot from 2020-05-26 18-32-47.png


Please let me know if I am missing anything to fix this error.

I am using the below FFmpeg command to send the stream to RTMP.

ffmpeg -i rtsp://root:FIRSTPort@10.0.1.6/axis-media/media.amp -c copy -f flv rtmp://3.17.58.240:1935/live/test
 

vamsi

New Member
Hi

The ffmpeg command doesn't play the camera stream.The player status is playing but no stream in it.

Screenshot_from_2020_05_26_23_00_13.png


Flashphoner logs:
Screenshot_from_2020_05_26_23_00_04.png



While running the FFmpeg command I am getting this
Screenshot_from_2020_05_26_23_08_59.png
 

vamsi

New Member
Hi Max,

Giving only the stream name worked for me. But I am facing 5 seconds delay in the playback. I have my WCS server in the AWS us-east-2 region. Is it possible to reduce the delay. Let me know what kind of information you need for that.
 

Max

Administrator
Staff member
Good day.
Please try to reduce publishing stream resolution/bitrate, for example to 640x360
Code:
ffmpeg -re -i rtsp://root:FIRSTPort@10.0.1.6/axis-media/media.amp -preset ultrafast -acodec aac -vcodec h264 -strict -2 -b:v 500K -vf scale=640:-2,setsar=1:1 -f flv rtmp://3.17.58.240:1935/live/test
Please also consider to migrate server to closest possible region to publisher/viewer
 

vamsi

New Member
Thanks for the update on the resolution.

Is there a way to move the position to live stream. For example, a button (Go live), clicking on which it will go the live. Is it possible to show the full screen in the popup(lightbox without play/pause icon)
 

vamsi

New Member
Thanks for the update Max.

Also is there a way to change the resolution for the full-screen view. In the normal view I want to show the video stream in 320 * 240 and in full screen mode I want to show in 1280 * 720. Is that possible?
 

Max

Administrator
Staff member
Also is there a way to change the resolution for the full-screen view. In the normal view I want to show the video stream in 320 * 240 and in full screen mode I want to show in 1280 * 720. Is that possible?
A stream will always be played with the same resolution as it published. To play the stream with another resolution, this stream should be transcoded by requesting width and height in constraints
Code:
session.createStream({name:"stream1", constraints:{audio:true, video:{width:640,height:480}}}).play();
But stream transcoding requires a much CPU resources.
In your case, we recommend to publish 1280x720 RTMP stream, then play it in div element with fixed size as preview
CSS:
.fp-remoteVideo {
    border: 1px double black;
    width: 320px;
    height: 240px;
    text-align: center;
    background: #c0c0c0;
    display: inline-block;
}
HTML:
<div class="fp-remoteVideo" id="remoteVideo"></div>
JavaScript:
var options = {
      name: streamName,
      display: remoteVideo
};
stream = session.createStream(options).on(STREAM_STATUS.PENDING, function (stream) {
      ...
});
stream.play();
 

vamsi

New Member
In my case I am publishing it as 1280 x 720 and tried the approach to play the video in dev with fixed size as a preview. But in the preview mode, the stream is more pixelated. In the full-screen mode it is good.
 

vamsi

New Member
I am seeing this all browser. I am publishing in 1280 X 720 and I use fixed-size 320x240. Since the width is too small, the see the preview shrinked.
 

Max

Administrator
Staff member
Please check if stream is pixelized when playing it in playback section of Two Way Streaming or Media Devices examples. If not, please provide us a minimally customized source code based on TwoWayStreaming to reproduce the problem, we will check.
 

vamsi

New Member
Hello

I created two sessions each with different resolution and used one for preview and other for full screen

Is there a way to disable pause functionality in the feed feed?
 

Max

Administrator
Staff member
Is there a way to disable pause functionality in the feed feed?
By default, video element created for stream playback contains no controls (and no play/pause if you don't create button on page).
To disable controls in fullscreen mode, use CSS:
CSS:
video::-webkit-media-controls {
  display:none !important;
}
 
Top