h264-live-player icon indicating copy to clipboard operation
h264-live-player copied to clipboard

Possible to run as ffmpeg codec copy instead of lib264?

Open erceth opened this issue 7 years ago • 1 comments

I got the code to run with ffmpeg settings like this:

var args = [
        '-re',
        "-i", "rtsp://@192.168.1.63:554/axis-media/media.amp?videocodec=h264&resolution=1280x720&h264profile=baseline",
        // "-framerate", this.options.fps,
        "-video_size", this.options.width + 'x' + this.options.height,
        '-pix_fmt',  'yuv420p',
        // '-c:v',  'copy',
        '-c:v',  'libx264',
        '-b:v', '600k',
        '-bufsize', '600k',
        '-vprofile', 'baseline',
        '-tune', 'zerolatency',
        '-f' ,'h264',
        '-'
    ];

The ffmpeg process on such a command takes up 100% of one of my cores and I would like to lower that. I see that the video codec output is set to libx264. My input stream is already h264. Am I correct in assuming that this command is converting h264 into h264? In my case I am wondering if that is necessary.

When I comment out '-c:v', 'libx264', and uncomment '-c:v', 'copy', the ffmpeg CPU usage drops to 1% but the canvas player is blank.

The canvas is also blank if I keep '-c:v', 'libx264', but comment out '-vprofile', 'baseline',

I know that broadway.js expects the h264 profile to be baseline. My guess is that '-vprofile', 'baseline', converts the output to the baseline profile. Is it possible for me to have the input be baseline and just use the copy codec?

erceth avatar Apr 28 '17 15:04 erceth

I have a camera (SONY RTSP Server) for which it happens to work this: var args = [ "-rtsp_transport", "tcp", "-i", "rtsp://172.20.19.103/media/video1" , "-an", '-pix_fmt', 'yuv420p', '-c:v', 'copy', '-f' ,'rawvideo', '-' ];

adrhc avatar Sep 06 '17 08:09 adrhc