ffmpeg stop to rtmp at Youtube live

Hi!

I have a problem, when I started live streaming to Youtube, my terminal print some problems…

max delay reached. need to consume packet\n’]
ffmpeg::process::data [data:'[sdp @ 0x561228ad0100] ‘]
ffmpeg::process::data [data:‘RTP: missed 138 packets\n’]
ffmpeg::process::data [data:’[sdp @ 0x561228ad0100] ‘]
ffmpeg::process::data [data:‘Missed a picture, sequence broken\n’]
ffmpeg::process::data [data:’[sdp @ 0x561228ad0100] ']
ffmpeg::process::data [data:'max delay reached. need to consume packet\n

Delay between the first packet and last packet in the muxing queue is 10011000 > 10000000: forcing output\n’]

Curiously, when I covered my Webcam, ffmpeg record and make live streaming normally…

My ffmpeg config :

let commandArgs = [
      '-loglevel',
      'debug',
      '-nostdin',
      '-protocol_whitelist',
      'file,pipe,udp,rtp',
      '-analyzeduration',
      '300M', 
      '-probesize', 
      '300M',
      '-fflags',
      '+genpts',
      '-f',
      'sdp',
      '-i',
      `pipe:0`,


    ];
 commandArgs = commandArgs.concat([
      '-flags',
      '+global_header',
      `${RECORD_FILE_LOCATION_PATH}/${this._rtpParameters.fileName}.flv`,
      '-pix_fmt',
      'yuv420p',
      '-preset', 
      'ultrafast',
      '-use_wallclock_as_timestamps',
      '1',
      '-tune',
      'zerolatency',
      '-qmin', '2','-qmax', '51','-muxrate','1300k',
      '-sdp_file',
      `${this._rtpParameters.fileName}.sdp`,
      '-r',
      '30',
      '-b:v',
      '1000k',
      '-bufsize',
      '1000k',
      '-minrate',
      '500k',
      '-maxrate',
      '2000k',
      '-qscale',
      '3',
      '-threads',
      '6', 
      '-b:a',
      '128k',
      '-framerate', 
       '30',
      '-g',
      '2',
      '-crf', 
      '30',
      '-ar',
      '48000',
      '-s',
      '854x480',
      '-f',     
      'flv',
      'rtmp://a.rtmp.youtube.com/live2/xxx-xxxx-xxxx-xxxx-xxxx'

    ]);



  get _videoArgs () {
    return [
      '-map',
      '0:v:0',
      '-max_muxing_queue_size',
      '999999',
      '-c:v',
      'libx264',


    ];
  }

  get _audioArgs () {
    return [
      '-map',
      '0:a:0',
      '-c:a', 
      'libmp3lame'

    ];
  }

Try to increase buffer size then.
If you cover webcam there is less video data flowing due to codec efficiency, probably it fits the buffer in that case.

2 Likes

Thanks man! I Will try It