跳至主要內容

NAS

wangdx大约 6 分钟

简介

按字面简单说就是连接在网络上,具备资料存储功能的装置,因此也称为“网络存储器”。它是一种专用数据存储服务器。它以数据为中心,将存储设备与服务器彻底分离,集中管理数据,从而释放带宽、提高性能、降低总拥有成本、保护投资。其成本远远低于使用服务器存储,而效率却远远高于后者。

为什么要用 NAS

    1. 照片备份
    1. 下载资源
    1. ”异地办公“
    1. 数据恢复

黑群晖

安装系统(电脑,U 盘)

  1. 此 U 盘将会被格式化,请备份资料,以后会一直插在当 NAS 的机器上当引导,不可移除

2.流程把前面制作好的引导 U 盘接入要当 NAS 的机器中、接上键鼠、显示器、网线

3.开机设置 U 盘启动

启动成功界面 出现局域网登录地址,浏览器登录该地址 http://192.168.6.247:7681/

4.选择群晖型号 常用 DS918+

5.选择版本 7.2

                                                                                                      BOOTING: [UEFI] [USB flashdisk]
Model: DS918+
Build: 7.2(69057)
LKM:   prod
DMI:   System manufacturer System Product Name/B250M-KYLIN, BIOS 0602 02/06/2017
CPU:   Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
MEM:   7823 MB
Cmdline:
withefi earlyprintk syno_hw_version=DS918+ console=ttyS0,115200n8 netif_num=2 pid=0x1665 earlycon=uart8250,io,0x3f8,115200n8 mac2=001132c01a87 mac1=001132c01a86 sn=1910PDN002145 vid=0x0951 elevator=elevator loglevel=15 HddHotplug=0 skip_vender_mac_interfaces=0,1,2,3,4,5,6,7 syno_hdd_detect=0 panic=5 vender_format_version=2 syno_hdd_powerup_seq=0 log_buf_len=32M root=/dev/md0
Detected 1 network cards.
Checking Connect.
eth0 connected.
Waiting IP.(For reference only)
eth0(r8168): Access http://192.168.6.247:5000 to connect the DSM via web.
 7s (Changing access(ssh/web) status will interrupt boot)
  1. 安装完成

正常来说此时可移除接在 NAS 主机上的屏幕和键鼠因为 NAS 正 E 常使用是不需要接屏幕的此时接屏幕的作用是为了查看引导信息和设置 BIOS 启动以上设置完成后,自然不需要屏幕和键鼠了

  1. 查看 ip 地址
1.路由地址查看 192.168.6.1 192.168.31.1等查看
2.https://finds.synology.com/在线查看
3.https://www.synology.cn/zh-cn/support/download/DS918+?version=7.2#system

8.安装成功

9.‘套件来源’,新增一个来源,添加失败的话,多试几次,一定是你的网络问题 synocommunity http://packages.synocommunity.com/

PuTTY https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

群晖端口号查询 https://www.synology.com/zh-cn/knowledgebase/DSM/tutorial/Network/What_network_ports_are_used_by_Synology_services

OpenSubtitle https://www.opensubtitles.org/zh/login

命令行: sudo -i vi /etc/hosts 13.224.161.90 api.themoviedb.org

sudo wget -N --no-check-certificate https://sh.9hut.cn/dsvp.sh && sudo bash dsvp.sh install

手笨,有些不合理的地方,感谢大家观看。 机箱作者:汪汪队射手(B 站) https://www.bilibili.com/video/BV1Kg411z7EG/

群晖 7.2 引导: https://github.com/wjz304/rr

购买清单资料: https://wwwj.lanzoue.com/b068crtxg 密码:9g0h

https://www.bilibili.com/video/BV1EE411W7oa/?p=4&spm_id_from=333.1007.top_right_bar_window_history.content.click&vd_source=666581528d12a99f116ef82fdd98027b

https://blog.csdn.net/l824828/article/details/108614849

video station

https://post.smzdm.com/p/akl60kd8/

https://zhiyou.smzdm.com/member/7503695741/article/

smtp

nuocccjbedpqbiae

端口

https://kb.synology.cn/zh-cn/DSM/tutorial/What_network_ports_are_used_by_Synology_services#packages

https://www.synology.cn/zh-cn/products-a-z#synology-photos

#备份 VideoStation's ffmpeg mv -n /var/packages/VideoStation/target/bin/ffmpeg /var/packages/VideoStation/target/bin/ffmpeg.orig #下载 ffmpeg 脚本 wget -O - https://gist.githubusercontent.com/BenjaminPoncet/bbef9edc1d0800528813e75c1669e57e/raw/ffmpeg-wrapper > /var/packages/VideoStation/target/bin/ffmpeg #设置脚本相应权限 chown root:VideoStation /var/packages/VideoStation/target/bin/ffmpeg chmod 750 /var/packages/VideoStation/target/bin/ffmpeg chmod u+s /var/packages/VideoStation/target/bin/ffmpeg

备份 VideoStation's libsynovte.so

cp -n /var/packages/VideoStation/target/lib/libsynovte.so /var/packages/VideoStation/target/lib/libsynovte.so.orig chown VideoStation:VideoStation /var/packages/VideoStation/target/lib/libsynovte.so.orig

为 libsynovte.so 添加 DTS, EAC3 and TrueHD 支持

sed -i -e 's/eac3/3cae/' -e 's/dts/std/' -e 's/truehd/dheurt/' /var/packages/VideoStation/target/lib/libsynovte.so #备份 CodecPack 的 ffmpeg41 cp /var/packages/CodecPack/target/bin/ffmpeg41 /var/packages/CodecPack/target/bin/ffmpeg41.bak #链接 ffmpeg 解码模块 cp /var/packages/VideoStation/target/bin/ffmpeg /var/packages/CodecPack/target/bin/ffmpeg41


#!/bin/bash

rev="12"

_log(){
	echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
}

_log_para(){
	echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} -          = &/" >> /tmp/ffmpeg.log
}

_term(){
	rm /tmp/ffmpeg-${streamid}.stderr
	_log "*** KILLCHILD ***"
	kill -TERM "$childpid" 2>/dev/null
}

trap _term SIGTERM

arch=`uname -a | sed 's/.*synology_//' | cut -d '_' -f 1`
nas=`uname -a | sed 's/.*synology_//' | cut -d '_' -f 2`
pid=$$
paramvs=$@
stream="${@: -1}"
streamid="FFM$pid"
bin1=/var/packages/ffmpeg/target/bin/ffmpeg
bin2=/var/packages/VideoStation/target/bin/ffmpeg.orig
args=()

vcodec="KO"

while [[ $# -gt 0 ]]
do
case "$1" in
	-i)
		shift
		movie="$1"
		args+=("-i" "$1")
	;;
	-hwaccel)
		shift
		hwaccel="$1"
		args+=("-hwaccel" "$1")
	;;
	-scodec)
		shift
		scodec="$1"
		args+=("-scodec" "$1")
	;;
	-f)
		shift
		fcodec="$1"
		args+=("-f" "$1")
	;;
	-map)
		shift
		args+=("-map" "$1")
		idmap=`echo $1 | cut -d : -f 2`
		if [ "$vcodec" = "KO" ]; then
			vcodec=`/var/packages/ffmpeg/target/bin/ffprobe -v error -select_streams $idmap -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$movie" | head -n 1`
			vcodecprofile=`/var/packages/ffmpeg/target/bin/ffprobe -v error -select_streams $idmap -show_entries stream=profile -of default=noprint_wrappers=1:nokey=1 "$movie" | head -n 1`
		else
			acodec=`/var/packages/ffmpeg/target/bin/ffprobe -v error -select_streams $idmap -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 "$movie" | head -n 1`
		fi
	;;
	*)
		args+=("$1")
	;;
esac
shift
done

_log "*** PROCESS START REV $rev DS$nas ($arch) PID $pid ***"

streamdir=`dirname "$stream"`
device=`cat ${streamdir}/video_metadata | jq -r '.device'`
_log "DEVICE   = $device"
_log "MOVIE    = $movie"

set -- "${args[@]}"

argsnew=()
args1sv=()
args2sv=()
args1vs=()
args2vs=()

while [[ $# -gt 0 ]]
do
case "$1" in
	-ss)
		shift
		argsnew+=("-ss" "$1")
		args1sv+=("-ss" "$1")
		args1sv+=("-noaccurate_seek")
		args1vs+=("-ss" "$1")
		args1vs+=("-noaccurate_seek")
		args2sv+=("-analyzeduration" "10000000")
		args2vs+=("-analyzeduration" "10000000")
	;;
	-i)
		shift
		argsnew+=("-i" "$1")
		args1sv+=("-i" "$1")
		args2sv+=("-i" "pipe:0" "-map" "0")
		args1vs+=("-i" "$1")
		args2vs+=("-i" "pipe:0" "-map" "0")
	;;
	-vf)
		shift
		if [ "$hwaccel" = "vaapi" ] && [ "$vcodecprofile" = "Main 10" ]; then
			scale_w=`echo "${1}" | sed -e 's/.*=w=//g' | sed -e 's/:h=.*//g'`
			scale_h=`echo "${1}" | sed -e 's/.*:h=//g'`
			if let ${scale_w} AND let ${scale_h}; then
				argsnew+=("-vf" "scale_vaapi=w=${scale_w}:h=${scale_h}:format=nv12,hwupload,setsar=sar=1")
			else
				argsnew+=("-vf" "scale_vaapi=format=nv12,hwupload,setsar=sar=1")
			fi
		else
			argsnew+=("-vf" "$1")
		fi
		args2sv+=("-vf" "$1")
		args1vs+=("-vf" "$1")
	;;
	-vcodec)
		shift
		argsnew+=("-vcodec" "$1")
		args1sv+=("-vcodec" "copy")
		args2sv+=("-vcodec" "$1")
		args1vs+=("-vcodec" "$1")
		args2vs+=("-vcodec" "copy")
	;;
	-acodec)
		shift
		if [ "$1" = "libfaac" ]; then
			argsnew+=("-acodec" "aac")
			args1sv+=("-acodec" "aac")
			args2vs+=("-acodec" "aac")
		else
			argsnew+=("-acodec" "$1")
			args1sv+=("-acodec" "$1")
			args2vs+=("-acodec" "$1")
		fi
		args2sv+=("-acodec" "copy")
		args1vs+=("-acodec" "copy")
	;;
	-ab)
		shift
		argsnew+=("-ab" "$1")
		args1sv+=("-ab" "$1")
		args2vs+=("-ab" "$1")
	;;
	-ac)
		shift
		argsnew+=("-ac" "$1")
		args1sv+=("-ac" "$1")
		args2vs+=("-ac" "$1")
	;;
	-f)
		shift
		argsnew+=("-f" "$1")
		args1sv+=("-f" "mpegts")
		args2sv+=("-f" "$1")
		args1vs+=("-f" "mpegts")
		args2vs+=("-f" "$1")
	;;
	-segment_format)
		shift
		argsnew+=("-segment_format" "$1")
		args2vs+=("-segment_format" "$1")
		args2sv+=("-segment_format" "$1")
	;;
	-segment_list_type)
		shift
		argsnew+=("-segment_list_type" "$1")
		args2vs+=("-segment_list_type" "$1")
		args2sv+=("-segment_list_type" "$1")
	;;
	-hls_seek_time)
		shift
		argsnew+=("-hls_seek_time" "$1")
		args2vs+=("-hls_seek_time" "$1")
		args2sv+=("-hls_seek_time" "$1")
	;;
	-segment_time)
		shift
		argsnew+=("-segment_time" "$1")
		args2vs+=("-segment_time" "$1")
		args2sv+=("-segment_time" "$1")
	;;
	-segment_time_delta)
		shift
		argsnew+=("-segment_time_delta" "$1")
		args2vs+=("-segment_time_delta" "$1")
		args2sv+=("-segment_time_delta" "$1")
	;;
	-segment_start_number)
		shift
		argsnew+=("-segment_start_number" "$1")
		args2vs+=("-segment_start_number" "$1")
		args2sv+=("-segment_start_number" "$1")
	;;
	-individual_header_trailer)
		shift
		argsnew+=("-individual_header_trailer" "$1")
		args2vs+=("-individual_header_trailer" "$1")
		args2sv+=("-individual_header_trailer" "$1")
	;;
	-avoid_negative_ts)
		shift
		argsnew+=("-avoid_negative_ts" "$1")
		args2vs+=("-avoid_negative_ts" "$1")
		args2sv+=("-avoid_negative_ts" "$1")
	;;
	-break_non_keyframes)
		shift
		argsnew+=("-break_non_keyframes" "$1")
		args2vs+=("-break_non_keyframes" "$1")
		args2sv+=("-break_non_keyframes" "$1")
	;;
	-max_muxing_queue_size)
		shift
		args2vs+=("-max_muxing_queue_size" "$1")
		args2sv+=("-max_muxing_queue_size" "$1")
	;;
	-map)
		shift
		argsnew+=("-map" "$1")
		args1sv+=("-map" "$1")
		args1vs+=("-map" "$1")
	;;
	*)
		argsnew+=("$1")
		if [ "$stream" = "$1" ]; then
			args1sv+=("-bufsize" "1024k" "pipe:1")
			args2sv+=("$1")
			args1vs+=("-bufsize" "1024k" "pipe:1")
			args2vs+=("$1")
		else
			args2sv+=("$1")
			args1vs+=("$1")
		fi
	;;
esac
shift
done

sed -i -e "s/{\"PID\":${pid},\"hardware_transcode\":true,/{\"PID\":${pid},\"hardware_transcode\":false,/" /tmp/VideoStation/enabled

startexectime=`date +%s`

if [ "$scodec" = "subrip" ]; then

	_log "FFMPEG   = $bin2"
	_log "CODEC    = $scodec"
	_log "PARAMVS  ="
	_log_para "$paramvs"

	$bin2 "${args[@]}" &> /tmp/ffmpeg-${streamid}.stderr &

elif [ "$fcodec" = "mjpeg" ]; then

	_log "FFMPEG   = $bin2"
	_log "CODEC    = $fcodec"
	_log "PARAMVS  ="
	_log_para "$paramvs"

	$bin2 "${args[@]}" &> /tmp/ffmpeg-${streamid}.stderr &

else

	_log "VCODEC   = $vcodec ($vcodecprofile)"
	_log "ACODEC   = $acodec"
	_log "PARAMVS  ="
	_log_para "$paramvs"
	_log "MODE     = WRAP"
	_log "FFMPEG   = $bin1"
	_log "PARAMWP  ="
	param1=${argsnew[@]}
	_log_para "$param1"

	$bin1 "${argsnew[@]}" &> /tmp/ffmpeg-${streamid}.stderr &

fi

childpid=$!
_log "CHILDPID = $childpid"
wait $childpid

if grep "Conversion failed!" /tmp/ffmpeg-${streamid}.stderr || grep "Error opening filters!" /tmp/ffmpeg-${streamid}.stderr || grep "Unrecognized option" /tmp/ffmpeg-${streamid}.stderr || grep "Invalid data found when processing input" /tmp/ffmpeg-${streamid}.stderr; then

	_log "*** CHILD END ***"
	startexectime=`date +%s`
	_log "STDOUT   ="
	_log_para "`tail -n 15 /tmp/ffmpeg-${streamid}.stderr`"
	_log "MODE     = PIPE SV"
	_log "FFMPEG1  = $bin1"
	_log "FFMPEG2  = $bin2"
	_log "PARAM1   ="
	param1=${args1sv[@]}
	_log_para "$param1"
	_log "PARAM2   ="
	param2=${args2sv[@]}
	_log_para "$param2"

	$bin1 "${args1sv[@]}" | $bin2 "${args2sv[@]}" &> /tmp/ffmpeg-${streamid}.stderr &

	childpid=$!
	_log "CHILDPID = $childpid"
	wait $childpid

fi

if grep "Conversion failed!" /tmp/ffmpeg-${streamid}.stderr || grep "Error opening filters!" /tmp/ffmpeg-${streamid}.stderr || grep "Unrecognized option" /tmp/ffmpeg-${streamid}.stderr || grep "Invalid data found when processing input" /tmp/ffmpeg-${streamid}.stderr; then

	_log "*** CHILD END ***"
	startexectime=`date +%s`
	_log "STDOUT   ="
	_log_para "`tail -n 15 /tmp/ffmpeg-${streamid}.stderr`"
	_log "MODE     = PIPE VS"
	_log "FFMPEG1  = $bin2"
	_log "FFMPEG2  = $bin1"
	_log "PARAM1   ="
	param1=${args1vs[@]}
	_log_para "$param1"
	_log "PARAM2   ="
	param2=${args2vs[@]}
	_log_para "$param2"

	$bin2 "${args1vs[@]}" | $bin1 "${args2vs[@]}" &> /tmp/ffmpeg-${streamid}.stderr &

	childpid=$!
	_log "CHILDPID = $childpid"
	wait $childpid

fi

if grep "Conversion failed!" /tmp/ffmpeg-${streamid}.stderr || grep "Error opening filters!" /tmp/ffmpeg-${streamid}.stderr || grep "Unrecognized option" /tmp/ffmpeg-${streamid}.stderr || grep "Invalid data found when processing input" /tmp/ffmpeg-${streamid}.stderr; then

	_log "*** CHILD END ***"
	startexectime=`date +%s`
	_log "STDOUT   ="
	_log_para "`tail -n 15 /tmp/ffmpeg-${streamid}.stderr`"
	_log "MODE     = ORIG"
	_log "FFMPEG   = $bin2"

	$bin2 "${args[@]}" &> /tmp/ffmpeg-${streamid}.stderr &

	childpid=$!
	_log "CHILDPID = $childpid"
	wait $childpid

fi

stopexectime=`date +%s`
if test $((stopexectime-startexectime)) -lt 10; then
	_log "STDOUT   ="
	_log_para "`tail -n 15 /tmp/ffmpeg-${streamid}.stderr`"
fi

_log "*** CHILD END ***"
_log "*** PROCESS END ***"

rm /tmp/ffmpeg-${streamid}.stderr

X86wJhEa7isjhe4fBwRtLeQ

https://spk7.imnks.com/

demo


上次编辑于: