Search code examples
ffmpegvideo-streaming

How to re-stream h265 RTSP stream using FFMPEG


I have written a small piece of code to re-stream camera RTSP stream on Nginx stream server using FFMPEG.

Everything working fine, my re-stream RTSP on to Nginx stream server using following FFMPEG command:

ffmpeg -rtsp_transport tcp -i 'rtsp://212.78.10.88:554/stream' -f lavfi -i aevalsrc=0 -vcodec copy -acodec aac -map 0:0 -map 1:0 -shortest -strict experimental -f flv rtmp://localhost:1935/live/stream

My basic problem is H265 and H265+. FFMPEG failed to re-stream H265 format streams. I tried differently command params but no luck.

Any body know how to re-stream H265 and + in FFMPEG?


Solution

  • Finally, I solved the issue to re-stream h265 stream.

    I just used following arguments in command to solve this issue.

    -c:v libx264 -pix_fmt yuv420p
    

    and final command is:

    ffmpeg -rtsp_transport tcp -i 'rtsp://212.78.10.88:554/stream' -f lavfi -i aevalsrc=0 -vcodec copy -acodec aac -map 0:0 -map 1:0 -c:v libx264 -pix_fmt yuv420p -shortest -strict experimental -f flv rtmp://localhost:1935/live/stream