torch2424 / live-stream-radio

24/7 live stream video radio station CLI / API πŸ“Ή πŸ“»

Home Page:https://torch2424.github.io/live-stream-radio/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'No such filter' Error from ffmpeg

JustinFincher opened this issue Β· comments

Hi, firstly thanks for such a great project to make own streaming radio!

When streaming, my running instance sometimes happened to have a ffmpeg crash, that I think may be related to misplaced font parameter or the quote escaping. (I really don't have a knowledge on ffmpeg here so I am just guessing πŸ€”)
The current playing song is called 1-09 Don't Worry, It's Okay.mp3, with song name metadata also called Don't Worry, It's Okay. The log have the following entry:

[Parsed_drawtext_8 @ 0x5579cf152240] Using "/usr/share/fonts/dejavu/DejaVuSans.ttf"
[AVFilterGraph @ 0x5579cf122680] No such filter: 'Its Okay:fontfile'

That's weird because I already set the custom font path in config.json (attached at the bottom), and it seemed that the filter name is prefixed with part of the song's name (Its Okay).

Log:

Using the config.json at: /root/projects/finfm/config.json


 --enable-libzvbi --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, gif, from '/tmp/live-stream-radio-gif-with-pal-1551431128822.gif':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: gif, bgra, 1080x622, 7.67 fps, 7.69 tbr, 100 tbn, 100 tbc
Input #1, mp3, from '/root/projects/finfm/audio/1-09 Don't Worry, It's Okay.mp3':
  Metadata:
    artist          : Shook
    album_artist    : Shook
    disc            : 1
    track           : 9
    title           : Don't Worry, It's Okay
    album           : Don't Worry, It's Okay
    date            : 2016
  Duration: 00:05:27.24, start: 0.025056, bitrate: 320 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
    Metadata:
      encoder         : LAME3.99r
    Side data:
      replaygain: track gain - -7.900000, track peak - unknown, album gain - unknown, album peak - unknown,
    Stream #1:1: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 185x185 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Other
Input #2, lavfi, from 'anullsrc':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #2:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
Input #3, png_pipe, from '/root/projects/finfm/live-stream-radio-overlay-image.png':
  Duration: N/A, bitrate: N/A
    Stream #3:0: Video: png, rgba(pc), 1920x1080, 25 tbr, 25 tbn, 25 tbc
[Parsed_drawtext_8 @ 0x5579cf152240] Using "/usr/share/fonts/dejavu/DejaVuSans.ttf"
[AVFilterGraph @ 0x5579cf122680] No such filter: 'Its Okay:fontfile'
Error initializing complex filters.
Invalid argument

ffmpeg stdout:


ffmpeg err:

 Error: ffmpeg exited with code 1: Error initializing complex filters.
Invalid argument

    at ChildProcess.<anonymous> (/usr/lib/node_modules/live-stream-radio/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)


ffmpeg encountered an error. 😨
Please see the stderror output above to fix the issue.

Config:

{
  "stream_url": "rtmp://a.rtmp.youtube.com/live2/$stream_key",
  "stream_key": "",
  "ffmpeg_path": "",
  "video_codec": "libx264",
  "audio_codec": "aac",
  "audio_bit_rate": "256k",
  "audio_sample_rate": "44100",
  "normalize_audio": true,
  "video_height": "1080",
  "video_width": "1920",
  "video_bit_rate": "1500k",
  "video_fps": "30",
  "bufsize": "2048k",
  "crf": "28",
  "preset": "superfast",
  "threads": 2,
  "max_gif_size": "1080",
  "api": {
    "host": "localhost",
    "port": "8000",
    "key": "",
    "number_of_history_items": 100
  },
  "radio": {
    "audio_directory": "./audio",
    "video_directory": "./video",
    "overlay": {
      "enabled": true,
      "font_path": "./fonts/leaguespartan-bold.ttf",
      "title": {
        "enabled": true,
        "text": "Fin.fm 24/7 Personal Radio",
        "font_color": "#FFFFFF",
        "font_border": "#000000",
        "font_size": "14",
        "enable_scroll": false,
        "font_scroll_speed": "20",
        "position_x": "2",
        "position_y": "5"
      },
      "artist": {
        "enabled": true,
        "label": "Artist: ",
        "font_color": "#FFFFFF",
        "font_border": "#000000",
        "font_size": "10",
        "position_x": "2",
        "position_y": "18"
      },
      "album": {
        "enabled": false,
        "label": "Album: ",
        "font_color": "#FFFFFF",
        "font_border": "#000000",
        "font_size": "10",
        "position_x": "2",
        "position_y": "30"
      },
      "song": {
        "enabled": true,
        "label": "Song: ",
        "font_color": "#FFFFFF",
        "font_border": "#000000",
        "font_size": "10",
        "position_x": "2",
        "position_y": "28"
      },
      "image": {
        "enabled": true,
        "image_path": "./live-stream-radio-overlay-image.png",
        "position_x": 0,
        "position_y": 0
      } 
    }
  },
  "interlude": {
    "enabled": "true",
    "frequency": "0.2",
    "audio_directory": "./interludes/audio",
    "video_directory": "./interludes/video",
    "overlay": {
      "enabled": true,
      "font_path": "./fonts/leaguespartan-bold.ttf",
      "title": 
      {
        "enabled": true,
        "text": "Loading ...",
        "font_color": "#FFFFFF",
        "font_border": "#000000",
        "font_size": "16",
        "position_x": "2",
        "position_y": "5"
      },
      "image": {
        "enabled": true,
        "image_path": "./live-stream-radio-overlay-image.png",
        "position_x": 0,
        "position_y": 0
      }
    }
  }
}

Environment:

Fedora 28

➜  ~ npm list --depth=0 -g
/usr/lib
β”œβ”€β”€ live-stream-radio@2.2.1
└── npm@6.4.1

ffmpeg version 4.0.3 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100

Helllo!

So it seems like your FFMPEG is not compiled with all the required libraries. See the Getting Started in the documentation for either compiling FFMPEG, or downloading a prebuilt FFMPEG with the libraries.

Let me know if that helps! Thanks! πŸ˜„

Hi, thanks for the reply, I tried to compile FFMPEG on my machine and the 'No such filter' issue seems to be solved for now (though I deleted the Don't Worry, It's Okay song at the first place so I don't have a chance validating that), but there is another Output with label 'videooutput' does not exist in any defined filter graph, or was already used elsewhere issue that seems to be similar to #97, and everytime my radio stopped there was a song that contains quote symbols in the metadata, like this:

Finding audio... 🎀


Playing the audio:
/root/projects/finfm/audio/Warm.mp3


Finding/Optimizing video... πŸ“Ί


Playing the video:
/root/projects/finfm/video/sony_tape.gif


Artist: Dre'es
Album: Warm
Song: Warm
Duration (seconds): 256



Spawned Ffmpeg with command:
ffmpeg -stream_loop -1 -i /tmp/live-stream-radio-gif-with-pal-1551588950207.gif -i /root/projects/finfm/audio/Warm.mp3 -f lavfi -re -i anullsrc -i /root/projects/finfm/live-stream-radio-overlay-image.png -filter_complex [1:a] adelay=3000|3000 [delayedaudio]; [delayedaudio][2:a] amix=inputs=2:duration=first:dropout_transition=3 [audiooutput]; [audiooutput] loudnorm [audiooutput]; [0:v] fps=fps=30 [inputvideo];[3:v][inputvideo] scale2ref [scaledoverlayimage][scaledvideo];[scaledvideo][scaledoverlayimage] overlay=x=0:y=0, drawtext=text='Fin.fm 24/7 Personal Radio':fontfile=/root/projects/finfm/./fonts/Montserrat-Bold.otf:fontsize=(w * 0.04666666666666667):bordercolor=#000000:borderw=1:fontcolor=#FFFFFF:y=(h * 0.05):x=(w * 0.02),drawtext=text='Dre'es':fontfile=/root/projects/finfm/./fonts/Montserrat-Bold.otf:fontsize=(w * 0.03333333333333333):bordercolor=#000000:borderw=1:fontcolor=#FFFFFF:y=(h * 0.18):x=(w * 0.02),drawtext=text='Warm':fontfile=/root/projects/finfm/./fonts/Montserrat-Bold.otf:fontsize=(w * 0.03333333333333333):bordercolor=#000000:borderw=1:fontcolor=#FFFFFF:y=(h * 0.28):x=(w * 0.02) [videooutput] -acodec copy -acodec copy -map [videooutput] -map [audiooutput] -r 30 -g 60 -t 262 -pix_fmt yuv420p -x264-params keyint=60:min-keyint=60:scenecut=-1 -s 1280x720 -b:v 3000k -b:a 256k -ar 44100 -acodec aac -vcodec libx264 -preset superfast -bufsize 5000k -crf 28 -threads 2 -f flv rtmp://a.rtmp.youtube.com/live2/<removed>

Audio Progress β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 0% | Time Playing: 0s |


β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ


ffmpeg stderr:

 ffmpeg version N-93265-g007c13e Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs=-lpthread --extra-libs=-lm --bindir=/root/bin --enable-gpl --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 47.102 / 58. 47.102
  libavformat    58. 26.101 / 58. 26.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, gif, from '/tmp/live-stream-radio-gif-with-pal-1551588950207.gif':
  Duration: 00:00:02.36, start: 0.000000, bitrate: 12445 kb/s
    Stream #0:0: Video: gif, bgra, 1080x581, 25 fps, 25 tbr, 100 tbn, 100 tbc
Input #1, mp3, from '/root/projects/finfm/audio/Warm.mp3':
  Metadata:
    title           : Warm
    artist          : Dre'es
    album           : Warm
  Duration: 00:04:15.53, start: 0.025056, bitrate: 338 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
    Metadata:
      encoder         : LAME3.99r
    Side data:
      replaygain: track gain - -3.300000, track peak - unknown, album gain - unknown, album peak - unknown,
    Stream #1:1: Video: png, rgb24(pc), 600x600, 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Other
Input #2, lavfi, from 'anullsrc':
  Duration: N/A, start: 0.000000, bitrate: 705 kb/s
    Stream #2:0: Audio: pcm_u8, 44100 Hz, stereo, u8, 705 kb/s
Input #3, png_pipe, from '/root/projects/finfm/live-stream-radio-overlay-image.png':
  Duration: N/A, bitrate: N/A
    Stream #3:0: Video: png, rgba(pc), 1920x1080, 25 tbr, 25 tbn, 25 tbc
Output with label 'videooutput' does not exist in any defined filter graph, or was already used elsewhere.

ffmpeg stdout:


ffmpeg err:

 Error: ffmpeg exited with code 1: Output with label 'videooutput' does not exist in any defined filter graph, or was already used elsewhere.

    at ChildProcess.<anonymous> (/usr/lib/node_modules/live-stream-radio/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)


ffmpeg encountered an error. 😨
Please see the stderror output above to fix the issue.

I have a slight feeling that it might be the comma in the artists name

I agree with @andreasWebDev This may be an issue with out safe string thing.

@JustinFincher

If you have the chance, feel free to open a PR to fix this πŸ˜„

I'll close this issue for clarity, feel free to reopen it if you have any more questions :)