Home>

Recording server construction by EPG Station

$npm start
>[email protected] start /home/pi/record/EPGStation
>node dist/server/index.js
[2020-09-23T23: 37: 58.759] [FATAL] system --config.json parse error
Corresponding source code
//config.json
{
    "readOnlyOnce": false,
    "serverPort": 8888,
    "mirakurunPath": "http + unix: //%2Fvar%2Frun%2Fmirakurun.sock /",
    "dbType": "sqlite3",
    "sqlite3": {
        "extensions": ["/home/pi/record/regexp.so"],


        "regexp": true
    },


    # "ffmpeg": "/ usr/local/bin/ffmpeg",
    "ffmpeg": "/ usr/bin/ffmpeg",
    # "ffprobe": "/ usr/local/bin/ffprobe",
    "ffprobe": "/ usr/bin/ffprobe",
    #Add save destination
    "recorded": "/ media/pi/MEMORY /",
    "recordedTmp": "/ media/pi/MEMORY /",
    "maxEncode": 2,
    "encode": [
        {
            "name": "H264",
            "cmd": "% NODE%% ROOT% /config/enc.js",
            "suffix": ".mp4",
            "default": true
        }
    ],,


    "recordedViewer": {
        "ios": "infuse: // x-callback-url/play? url = http: // ADDRESS",
        "android": "intent: // ADDRESS # Intent;package = com.mxtech.videoplayer.ad;type = video;scheme = http;end"
    },


    "recordedDownloader": {
        "ios": "vlc-x-callback: // x-callback-url/download? url = http: // ADDRESS&filename = FILENAME",
        "android": "intent: //ADDRESS#Intent;package = com.dv.adm;type = video;scheme = http;end"
    },


    "maxStreaming": 2,
    "mpegTsStreaming": [
        {
            "name": "720p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 0 -c: a aac -ar 48000 -b: a 192k -ac 2 -c: v libx264 -vf yadif, scale = -2: 720 -b: v 3000k -preset veryfast -y -f mpegts pipe: 1 "
        },{
            "name": "480p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 0 -c: a aac -ar 48000 -b: a 128k -ac 2 -c: v libx264 -vf yadif, scale = -2: 480 -b: v 1500k -preset veryfast -y -f mpegts pipe: 1 "
        },


        {
            "name": "no conversion"
        }
    ],,


    "mpegTsViewer": {
        "ios": "vlc-x-callback: // x-callback-url/stream? Url = http: // ADDRESS",
        "android": "intent: // ADDRESS # Intent;package = com.mxtech.videoplayer.ad;type = video;scheme = http;end"
    },


    "recordedHLS": [
        {
            "name": "720p",
            "cmd": "% FFMPEG% -dual_mono_mode main -i% INPUT% -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_filename% streamFileDir%/stream% % -% 09d.ts -c: a aac -ar 48000 -b: a 192k -ac 2 -c: v libx264 -vf yadif, scale = -2: 720 -b: v 3000k -preset veryfast -flags + loop- global_header% OUTPUT% "
        },


        {
            "name": "480p",
            "cmd": "% FFMPEG% -dual_mono_mode main -i% INPUT% -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_filename% streamFileDir%/stream% % -% 09d.ts -c: a aac -ar 48000 -b: a 128k -ac 2 -c: v libx264 -vf yadif, scale = -2: 480 -b: v 1500k -preset veryfast -flags + loop- global_header% OUTPUT% "
        },


        {
            "name": "480p (h265)",
            "cmd": "% FFMPEG% -dual_mono_mode main -i% INPUT% -sn -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 0 -hls_allow_cache 1 -hls_segment_type fmp4 -hls_fmp4_init_filename stream mp4 -hls_segment_filename stream% streamNum%-% 09d.m4s -c: a aac -ar 48000 -b: a 128k -ac 2 -c: v libx265 -vf yadif, scale = -2: 480 -b: v 350k -preset veryfast -tag: v hvc1% OUTPUT% "
        }
    ],,


    "liveHLS": [
        {
            "name": "720p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename% streamFileDir%/stream % streamNum%-% 09d.ts -c: a aac -ar 48000 -b: a 192k -ac 2 -c: v libx264 -vf yadif, scale = -2: 720 -b: v 3000k -preset veryfast -flags + loop-global_header% OUTPUT% "
        },


        {
            "name": "480p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename% streamFileDir%/stream % streamNum%-% 09d.ts -c: a aac -ar 48000 -b: a 128k -ac 2 -c: v libx264 -vf yadif, scale = -2: 480 -b: v 1500k -preset veryfast -flags + loop-global_header% OUTPUT% "
        },


        {
            "name": "180p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 0 -map 0 -ignore_unknown -max_muxing_queue_size 1024 -f hls -hls_time 3 -hls_list_size 17 -hls_allow_cache 1 -hls_segment_filename% streamFileDir%/stream % streamNum%-% 09d.ts -c: a aac -ar 48000 -b: a 48k -ac 2 -c: v libx264 -vf yadif, scale = -2: 180 -b: v 100k -preset veryfast -maxrate 110k -bufsize 1000k -flags + loop-global_header% OUTPUT% "
        }
    ],,"liveWebM": [
        {
            "name": "720p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 3 -c: a libvorbis -ar 48000 -b: a 192k -ac 2 -c: v libvpx-vp9 -vf yadif, scale = -2: 720 -b: v 3000k -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe: 1 "
        },


        {
            "name": "480p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 2 -c: a libvorbis -ar 48000 -b: a 128k -ac 2 -c: v libvpx-vp9 -vf yadif, scale = -2: 480 -b: v 1500k -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe: 1 "
        }
    ],,


    "liveMP4": [
    {
        "name": "h264_omx",
        "cmd": "% FFMPEG% -dual_mono_mode main -re -i pipe: 0 -sn -codec: a aac -ar 48000 -ac 2 -b: a 192k -codec: v h264_omx -b: v 3000k -movflags frag_keyframe + empty_moov + faststart + default_base_moof -y -f mp4 pipe: 1 "
    },


        {
            "name": "720p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 0 -c: a aac -ar 48000 -b: a 192k -ac 2 -c: v libx264 -vf yadif, scale = -2: 720 -b: v 3000k -profile: v baseline -preset veryfast -tune fastdecode, zerolatency -movflags frag_keyframe + empty_moov + faststart + default_base_moof -y -f mp4 pipe: 1 "
        },


        {
            "name": "480p",
            "cmd": "% FFMPEG% -re -dual_mono_mode main -i pipe: 0 -sn -threads 0 -c: a aac -ar 48000 -b: a 128k -ac 2 -c: v libx264 -vf yadif, scale = -2: 480 -b: v 1500k -profile: v baseline -preset veryfast -tune fastdecode, zerolatency -movflags frag_keyframe + empty_moov + faststart + default_base_moof -y -f mp4 pipe: 1 "
        }
    ],,


    "recordedStreaming": {
        "webm": [
            {
                "name": "720p",
                "cmd": "% FFMPEG% -dual_mono_mode main% RE% -i pipe: 0 -sn -threads 3 -c: a libvorbis -ar 48000 -ac 2 -c: v libvpx-vp9 -vf yadif, scale = -2 : 720% VB%% VBUFFER%% AB%% ABUFFER% -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe: 1 ",,
                "vb": "3000k",
                "ab": "192k"
            },


            {
                "name": "360p",
                "cmd": "% FFMPEG% -dual_mono_mode main% RE% -i pipe: 0 -sn -threads 2 -c: a libvorbis -ar 48000 -ac 2 -c: v libvpx-vp9 -vf yadif, scale = -2 : 360% VB%% VBUFFER%% AB%% ABUFFER% -deadline realtime -speed 4 -cpu-used -8 -y -f webm pipe: 1 ",,
                "vb": "1500k",
                "ab": "128k"
            }
        ],,


        "mp4": [
            {
                "name": "720p","cmd": "% FFMPEG% -dual_mono_mode main% RE% -i pipe: 0 -sn -threads 0 -c: a aac -ar 48000 -ac 2 -c: v libx264 -vf yadif, scale = -2: 720 % VB%% VBUFFER%% AB%% ABUFFER% -profile: v baseline -preset veryfast -tune fastdecode, zerolatency -movflags frag_keyframe + empty_moov + faststart + default_base_moof -y -f mp4 pipe: 1 ",
                "vb": "3000k",
                "ab": "192k"
            },


            {
                "name": "360p",
                "cmd": "% FFMPEG% -dual_mono_mode main% RE% -i pipe: 0 -sn -threads 0 -c: a aac -ar 48000 -ac 2 -c: v libx264 -vf yadif, scale = -2: 360 % VB%% VBUFFER%% AB%% ABUFFER% -profile: v baseline -preset veryfast -tune fastdecode, zerolatency -movflags frag_keyframe + empty_moov + faststart + default_base_moof -y -f mp4 pipe: 1 ",
                "vb": "1500k",
                "ab": "128k"
            }
        ],,


        "mpegTs": [
            {
                "name": "720p (H.264)",
                "cmd": "% FFMPEG% -dual_mono_mode main% RE% -i pipe: 0 -sn -threads 0 -c: a aac -ar 48000 -ac 2 -c: v libx264 -vf yadif, scale = -2: 720 % VB%% VBUFFER%% AB%% ABUFFER% -profile: v baseline -preset veryfast -tune fastdecode, zerolatency -y -f mpegts pipe: 1 ",
                "vb": "3000k",
                "ab": "192k"
            },


            {
                "name": "360p (H.264)",
                "cmd": "% FFMPEG% -dual_mono_mode main% RE% -i pipe: 0 -sn -threads 0 -c: a aac -ar 48000 -ac 2 -c: v libx264 -vf yadif, scale = -2: 360 % VB%% VBUFFER%% AB%% ABUFFER% -profile: v baseline -preset veryfast -tune fastdecode, zerolatency -y -f mpegts pipe: 1 ",
                "vb": "1500k",
                "ab": "128k"
            }
        ]
    }
}
What I tried

Play with config.json
$npm run build
$npm start
Repeat

Supplementary information (FW/tool version, etc.) Reference site

Change the original file referring to the following site
https://medium.com/chinachu/c98v-raspberry-pi-4-49c9692f5c09

Model used

RaspberryPi 3
OS Raspbian GNU/Linux 10
debian version 10.4

version

$node --version
v14.12.0

$ffmpeg -version
ffmpeg version 4.1.6-1 ~ deb10u1 + rpt1 Copyright (c) 2000-2020 the FFmpeg developers

$python --version
Python 3.7.3

$gcc --version
gcc (Raspbian 8.3.0-6 + rpi1) 8.3.0

$sqlite3 --version
3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1

The location of extensions, ffmpeg, ffprobe, recordedTmp, recorded in sqlite3 has been confirmed

  • Answer # 1

    #Delete all the lines commented out in

    The parsing of config.json of EPGStation seems to be here in source code.
    https://github.com/l3tnun/EPGStation/blob/8f68dd97bd2767aeae6a5064184f2b5dee2aab47/src/server/Configuration.ts#L73

    JSON.parseI don't think it can be commented out because I am using.

  • Answer # 2

    Play with config.json

    The "Tried" column should not mean that you want an appeal that "I'm trying too". In order to contribute to the elucidation and solution of a problem, it is meaningless without specific information that "this happened."

    Anyway.
    config.json parse errorSo, I suspect that there is something wrong with the grammar level in the json file.
    I understand that json can't be commented normally, can I do this?
    Is the deletion of "comment" included in "play with"?