Download dataset_code/test.sh from SuperCS/useful_code: direct link, hf CLI and curl.
- Browser
- Download file 559 Bytes
-
https://huggingface.co/datasets/SuperCS/useful_code/resolve/e31e7b4c95a577cc71d9084c97befecffb3ebf56/dataset_code/test.sh
- Command line
-
hf download hf://datasets/SuperCS/useful_code@e31e7b4c95a577cc71d9084c97befecffb3ebf56/dataset_code/test.sh
-
curl -L -o test.sh https://huggingface.co/datasets/SuperCS/useful_code/resolve/e31e7b4c95a577cc71d9084c97befecffb3ebf56/dataset_code/test.sh
559 Bytes
| input_file="/mnt/bn/yufan-dev-my/ysh/Ckpts/SpatialVID/e6d91e1b-e366-5fa9-aef4-9769eb0bf631.mp4" | |
| output_file="output_trimmed.mp4" | |
| # 获取总帧数 | |
| total_frames=$(ffprobe -v quiet -select_streams v:0 -count_frames -show_entries stream=nb_frames -of csv=p=0 "$input_file") | |
| # 计算要保留的帧数 | |
| keep_frames=$((total_frames - 19)) | |
| # 执行裁剪 | |
| ffmpeg -i "$input_file" -vf "select='lt(n,$keep_frames)'" -vsync 0 -c:a copy "$output_file" | |
| echo "处理完成: $output_file" | |
| echo "原始帧数: $total_frames" | |
| echo "保留帧数: $keep_frames" | |