0

I have tried transcoding stream from VP8 to H264 using command line it's working fine but when I tried the same thing using fluent-ffmpeg it is not working as expected.

Version information

fluent-ffmpeg version: "2.1.2"

ffmpeg version: "3.4.4-1~16.04.york0"

OS: "Ubuntu"

Trasncoding from VP8 to H264 is working using command

ffmpeg -analyzeduration 300M -probesize 300M -protocol_whitelist file,udp,rtp -i portal-vp8.sdp -c:v libx264 -profile:v high -level:v 3.2 -pix_fmt yuv420p -x264-params keyint=25:scenecut=0 -r 25 -c:a aac -ar 16k -ac 1 -preset ultrafast -tune zerolatency -f flv rtmp://my-server-ip/myapp/testvp8

My sdp is

v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 55.2.100
m=audio 5396 TCP 111
a=rtpmap:111 opus/48000
m=video 5398 RTP/AVP 100
a=rtpmap:100 VP8/90000
a=fmtp:100 packetization-mode=1

Trasncoding from VP8 to H264 is not working using library

var sdpString = "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=No Name\r\nc=IN IP4 127.0.0.1\r\nt=0 0\r\na=tool:libavformat 55.2.100\r\nm=audio 5120 TCP 111\r\na=rtpmap:111 opus/48000\r\nm=video 5122 RTP/AVP 100\r\na=rtpmap:100 VP8/90000";

let sdp = stringToStream(sdpString);
var inputOptions = [];
    inputOptions.push('-analyzeduration');
    inputOptions.push('300M');
    inputOptions.push('-probesize');
    inputOptions.push('300M');
    inputOptions.push('-protocol_whitelist');
    inputOptions.push('file,udp,rtp,pipe');

var outputOptions = [];
    outputOptions.push('-c:v');
    outputOptions.push('libx264');

    outputOptions.push('-profile:v');
    outputOptions.push('high');

    outputOptions.push('-level:v');
    outputOptions.push('3.2');

    outputOptions.push('-pix_fmt');
    outputOptions.push('yuv420p');

    outputOptions.push('-x264-params');
    outputOptions.push('keyint=25:scenecut=0');

    outputOptions.push('-r');
    outputOptions.push('25');

    outputOptions.push('-c:a');
    outputOptions.push('aac');

    outputOptions.push('-ar');
    outputOptions.push('16k');

    outputOptions.push('-ac');
    outputOptions.push('1');

    outputOptions.push('-preset');
    outputOptions.push('ultrafast');

    outputOptions.push('-tune');
    outputOptions.push('zerolatency');

    outputOptions.push('-f');
    outputOptions.push('flv');

var outputUrl = "rtmp://my-server-ip/myapp/testvp8";

var command = FfmpegCommand(sdp).inputOptions(inputOptions).outputOptions(outputOptions).output(outputUrl)
        .on('start', function (commandLine) {
            console.log('Spawned Ffmpeg with command: ' + commandLine);
        })
        .on('stderr', function(stderrLine) {
            console.log('FFMPEG Stderr output: ' + stderrLine);
        });

    command.run();
});

Produced command using library

ffmpeg -analyzeduration 300M -probesize 300M -protocol_whitelist file,udp,rtp,pipe -i pipe:0 -c:v libx264 -profile:v high -level:v 3.2 -pix_fmt yuv420p -x264-params keyint=25:scenecut=0 -r 25 -c:a aac -ar 16k -ac 1 -preset ultrafast -tune zerolatency -f flv rtmp://my-server-ip/myapp/testvp8

FFmpeg logs

FFMPEG Stderr output: ffmpeg version 3.4.4-1~16.04.york0 Copyright (c) 2000-2018 the FFmpeg developers
FFMPEG Stderr output:   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
FFMPEG Stderr output:   configuration: --prefix=/usr --extra-version='1~16.04.york0' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
FFMPEG Stderr output:   libavutil      55. 78.100 / 55. 78.100
FFMPEG Stderr output:   libavcodec     57.107.100 / 57.107.100
FFMPEG Stderr output:   libavformat    57. 83.100 / 57. 83.100
FFMPEG Stderr output:   libavdevice    57. 10.100 / 57. 10.100
FFMPEG Stderr output:   libavfilter     6.107.100 /  6.107.100
FFMPEG Stderr output:   libavresample   3.  7.  0 /  3.  7.  0
FFMPEG Stderr output:   libswscale      4.  8.100 /  4.  8.100
FFMPEG Stderr output:   libswresample   2.  9.100 /  2.  9.100
FFMPEG Stderr output:   libpostproc    54.  7.100 / 54.  7.100
FFMPEG Stderr output: [sdp @ 0x55c28151c180] max delay reached. need to consume packet
FFMPEG Stderr output: [sdp @ 0x55c28151c180] RTP: missed 1 packets

Observed results

I have observed that inputted VP8 stream is not transcoded to H264 using FFmpeg library

Expected results

Inputted VP8 stream should be transcoded to H264 using the library.

Please help so how can I resolve the issue.

Mihir Patel
  • 404
  • 6
  • 14
  • "Not working as expected" is insufficient information to diagnose the problem. Please include the error output from ffmpeg. – cdhowie Sep 02 '19 at 05:05
  • I have added logs – Mihir Patel Sep 02 '19 at 05:16
  • The logs appear to be incomplete. They only give ffmpeg's standard startup information. – cdhowie Sep 02 '19 at 05:22
  • Other logs added – Mihir Patel Sep 02 '19 at 05:35
  • It seems that you have a problem feeding data to fluent ffmpeg (see `max delay reached`). In other words, the problem is probably not ffmpeg but the SDP side. – nalply Sep 02 '19 at 11:57
  • My sdp is var sdpString = "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=No Name\r\nc=IN IP4 127.0.0.1\r\nt=0 0\r\na=tool:libavformat 55.2.100\r\nm=audio 5120 TCP 111\r\na=rtpmap:111 opus/48000\r\nm=video 5122 RTP/AVP 100\r\na=rtpmap:100 VP8/90000"; – Mihir Patel Sep 02 '19 at 13:59
  • v=0 o=- 0 0 IN IP4 127.0.0.1 s=No Name c=IN IP4 127.0.0.1 t=0 0 a=tool:libavformat 55.2.100 m=audio 5396 TCP 111 a=rtpmap:111 opus/48000 m=video 5398 RTP/AVP 100 a=rtpmap:100 VP8/90000 a=fmtp:100 packetization-mode=1 – Mihir Patel Sep 03 '19 at 04:34
  • Did you find solution? Same issue for me. – Ankit Maheshwari Oct 26 '20 at 04:23

0 Answers0