tar -cf cuda1.tar /usr/local/cuda
sudo docker rm -f encoder
sudo docker run -itd --name encoder --restart always --gpus all --add-host rcc.work:192.168.126.37 ubuntu
sudo docker cp /usr/local/cuda/. encoder:/usr/local/cuda
sudo docker cp /usr/lib/x86_64-linux-gnu/. encoder:/usr/lib/x86_64-linux-gnu
sudo docker cp /etc/alternatives/. encoder:/etc/alternatives
echo 'Acquire::http::Proxy "http://rcc.work:3142";' > /etc/apt/apt.conf
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
apt-get -y update && apt-get -y upgrade
apt-get -y install apt-utils
apt-get -y install dialog
git build-essential
#https://docs.nvidia.com/video-technologies/video-codec-sdk/12.0/ffmpeg-with-nvidia-gpu/index.html
cd ~
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers && make install && cd ~
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg/
cd ffmpeg
apt-get -y install yasm pkg-config nasm libx264-dev libx265-dev libnuma-dev libpostproc-dev libass-dev fontconfig libavcodec-dev libavformat-dev software-properties-common libfaac-dev
echo '/usr/local/lib' >> /etc/ld.so.conf
echo 'cd /root/' >> ~/.bashrc
echo 'CUDA_HOME=/usr/local/cuda' >> ~/.bashrc
echo 'PATH=${CUDA_HOME}/bin:${PATH}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64' >> ~/.bashrc
./configure --enable-nonfree --enable-cuda --enable-cuvid --enable-nvenc --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared --enable-gpl --enable-libx264 --enable-libx265 --enable-libass --enable-fontconfig --enable-libfribidi --enable-libfontconfig --enable-libfdk-aac
make -j 6 && make install
mkdir /usr/local/cuda
mkdir
#!/bin/bash
INPUT_MOV='gun.mp4'
INPUT_SUB='English.srt'
INPUT_SUB='gun.srt'
OUTPUT_MOV='gun2.mkv'
CPU='libx264'
GPU='hevc_nvenc'
ffmpeg \
-hwaccel_output_format cuda \
-i ${INPUT_MOV} -c:v ${GPU} \
-vf "subtitles=${INPUT_SUB}:force_style='FontName=Malgun Gothic,FontSize=24',scale=hd720" \
-c:a aac -b:a 192k -ac 2 -y -f matroska \
${OUTPUT_MOV}
sshpass -p 1 sftp -P 20536 byun1114@office.work << EOF
cd TMP
put ${OUTPUT_MOV}
EOF