Sample Header Ad - 728x90

ffmpeg truncates paths on output when there are dots involved when run on bash

1 vote
1 answer
703 views
If I have a path with dots in the path, for instance: /home/user/Documents/hello/test.testing_23-24.123/test.testing_23-24.124 ffmpeg can locate the file if you pass the file's path as an argument but it will truncate the path name to the first dot it encounters in the file's path when it outputs the file. For instance, I got this: #!/bin/sh src_folder=pwd for filename in "${src_folder}"/*.MP4 do ffmpeg -threads 0 -probesize 100M -analyzeduration 100M -i "${filename}" \ -c:v libx265 -preset medium -pass 1 -tune grain -x265-params "crf=28:pmode=yes" \ -c:a libmp3lame -q:a 9 -strict experimental "${filename%%.*}"_1stpass.mkv done The output states: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/user/Documents/hello/test.testing_23-24.123/test.testing_23-24.124/GOPR2103.MP4': [..] Output #0, matroska, to '/home/user/Documents/hello/test_hevc.mkv': We see that the output file's folder path below: /home/user/Documents/hello/test.testing_23-24.123/test.testing_23-24.124 Gets truncated after ffmpeg encounters the first dot in it's output path. This only happens to the output's filename. Also it uses the truncated path as the filename. Anyone that could point me in the right direction on how to solve this? PS: I am aware that a bad workaround should be avoiding folders with dots :]
Asked by sternumbeef (11 rep)
Jul 27, 2018, 08:12 PM
Last activity: Jul 28, 2018, 12:40 AM