Reputation: 13
I have a task to:
I want to deal with every .mp4 .mov and .mkv as a variable in bash so that I can perform the above-mentioned tasks. The folder containing these files are in
/mnt/volume1/videos
directory architecture
/mnt/volum1/videos/sample.mp4
/mnt/volum1/videos/sample.mov
/mnt/volum1/videos/sample.mkv
Upvotes: 0
Views: 415
Reputation: 779
You can successively put every .mp4 .mov and .mkv file from your directory in a variable with a loop like that :
cd /mnt/volum1/videos/
for curFile in *.mp4 *.mov *.mkv ; do
echo $curFile
done
you can remove the extension of the filename (everything that is after the last '.' 'of the filename) with the following variable substitution:
${curfile%.*}
I don't know about HLS, but here is a simple ffmpeg example: If you call ffmpeg to make an avi file, it will look like:
ffmpeg -i $curfile ${curfile%.*}.avi
Upvotes: 1