Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- dir="/media/raid/TMO_Media"
- dir2="/media/raid/Hotfolder"
- trans="/media/raid/transcode"
- trans2="/media/raid/transcode2"
- {
- inotifywait -m -r -e close_write -e moved_to --format "%w%f" "$dir" | while read f
- do
- echo "$f"
- path="${f#$dir}"
- path2="${path#"/"}"
- path3="${path%/*}"
- movepath="$dir2$path3"
- transpath="$trans$path"
- file="$f"
- if ffprobe "$file" 2>&1 | egrep 'Stream #0:0: Video' && ffprobe "$file" 2>&1 | egrep 'MXF' ; then
- mkdir -vp "$movepath" && mkdir -vp "$trans$path3" && mkdir -vp "$trans2$path3" && mv -fu "$f" "$trans2$path" && \
- #./transcode.sh "$trans2$path" "$transpath" "$movepath"
- ffmpeg -y -i "$file" -map_metadata 0 -c:v h264_nvenc -b:v 2m -bufsize 2m -profile:v baseline -level:v 3.0 -pix_fmt yuv420p -vf yadif,scale="iw/4:ih/4" -an "$transpath" 2>> copy_ffmpeg_log.txt
- mv -fu "$transpath" "$movepath" &&
- echo "transcode finished" && \
- && rm -f "$file" && \
- date "+%H:%M:%S %d/%m/%y"
- else
- mkdir -vp "$movepath" && \
- mv -fu "$file" "$movepath" && echo "move finished" && rm -f "$file" && date "+%H:%M:%S %d/%m/%y" && \
- date "+%H:%M:%S %d/%m/%y"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement