rupeshforu3
Disciple
Hi I am Rupesh from India and I have a PC with windows 8 and open suse Linux installed. I have some MP4 video files of large size. I want to compress these files using ffmpeg command line tool not gui. I can't do this work because the file names consists of non ASCII characters.
There are 150 files to be converted. In the command prompt when I navigate to this directory and issue the command "ls -name" I am getting output as lines containing non ASCII characters with English characters. When I run the command "ls -name > names.txt" and open the text file in text editor I am able to see correct file names.
In the names.txt file one of the line consists of xxxxx_english_charecters_xxxxx.mp4. In this line xxxxx are non ASCII characters i mean characters from other non English language.
I have issued the following command
ffmpeg -i -y xxxxx_english_charecters_xxxxx.mp4 -c:v libx265 -b:v 400k -c:a aac -b:a 64k -ar 44100 output.mp4.
After issuing the above mentioned command I am getting error from ffmpeg command as below
File xxxxx_english_charecters_xxxxx.mp4 not found.
My complaint is that windows command prompt or linux terminal emulator are unable to display or interpret non ASCII characters.
I have written a small shell script for Linux as below
for i in *.mp4;
do name=`echo $i | cut -d'.' -f1`;
echo $name;
ffmpeg -i "$i" -c:v libx265 -b:v 400k -c:a aac -b:a 64k -ar 44100 "${name}_compressed.mp4";
done
After that I given execute permission to this script file and tried to execute
Upon running the above script in terminal emulator i am getting continuous errors from ffmpeg command as
File unknown
File unknown
After that I have written a batch script for windows as follows
@Echo off
setlocal EnableExtensions DisableDelayedExpansion
rem // Define constants here:
set "_SOURCE=E:\to_convert\new2"
set "_TARGET=F:\FFOutput"
rem // Change to source directory temporarily:
pushd "%_SOURCE%" || exit /B 1
rem // Enumerate source files, return paths relative to the source directory:
for /F "delims=" %%F in ('xcopy /L /S /I ".\*.mp4" "%_TARGET%" ^| find "."') do (
echo Currently converting "%%F"...
rem // Create destination directory, suppress error if it aready exists:
mkdir "%_TARGET%\%%F\.." 2> nul
rem // Perform actual file conversion, using paths relative to target directory:
ffmpeg -y -i "%%F" -c:v libx265 -b:v 400k -pass 2 -c:a aac -b:a 48k -ar 44100 "%_TARGET%\%%F\..\%%~nF.mp4"
)
echo Completed.
popd
endlocal
exit /B
After execution of this batch file also I am getting continuous errors from ffmpeg command as
File not found
File not found.
If you can't believe my words try to create an empty file with file name containing chinise characters in windows command prompt or Linux terminal emulator using command like touch. Definitely you will fail to create.
Even if you can't believe my words try to download or copy any file from internet with file name containing chinise characters. After that try to navigate to the directory downloaded in windows power shell and issue the ls command and definitely you are not going to see file you downloaded.
I have searched web for " unicode support in command prompt " " unicode support in terminal emulator " but I have not found any suitable solution.
Can anyone of you suggest how to work with command line tools like ffmpeg, touch and using these commands in shell scripting or windows command prompt and windows power shell.
Regards,
Rupesh.
There are 150 files to be converted. In the command prompt when I navigate to this directory and issue the command "ls -name" I am getting output as lines containing non ASCII characters with English characters. When I run the command "ls -name > names.txt" and open the text file in text editor I am able to see correct file names.
In the names.txt file one of the line consists of xxxxx_english_charecters_xxxxx.mp4. In this line xxxxx are non ASCII characters i mean characters from other non English language.
I have issued the following command
ffmpeg -i -y xxxxx_english_charecters_xxxxx.mp4 -c:v libx265 -b:v 400k -c:a aac -b:a 64k -ar 44100 output.mp4.
After issuing the above mentioned command I am getting error from ffmpeg command as below
File xxxxx_english_charecters_xxxxx.mp4 not found.
My complaint is that windows command prompt or linux terminal emulator are unable to display or interpret non ASCII characters.
I have written a small shell script for Linux as below
for i in *.mp4;
do name=`echo $i | cut -d'.' -f1`;
echo $name;
ffmpeg -i "$i" -c:v libx265 -b:v 400k -c:a aac -b:a 64k -ar 44100 "${name}_compressed.mp4";
done
After that I given execute permission to this script file and tried to execute
Upon running the above script in terminal emulator i am getting continuous errors from ffmpeg command as
File unknown
File unknown
After that I have written a batch script for windows as follows
@Echo off
setlocal EnableExtensions DisableDelayedExpansion
rem // Define constants here:
set "_SOURCE=E:\to_convert\new2"
set "_TARGET=F:\FFOutput"
rem // Change to source directory temporarily:
pushd "%_SOURCE%" || exit /B 1
rem // Enumerate source files, return paths relative to the source directory:
for /F "delims=" %%F in ('xcopy /L /S /I ".\*.mp4" "%_TARGET%" ^| find "."') do (
echo Currently converting "%%F"...
rem // Create destination directory, suppress error if it aready exists:
mkdir "%_TARGET%\%%F\.." 2> nul
rem // Perform actual file conversion, using paths relative to target directory:
ffmpeg -y -i "%%F" -c:v libx265 -b:v 400k -pass 2 -c:a aac -b:a 48k -ar 44100 "%_TARGET%\%%F\..\%%~nF.mp4"
)
echo Completed.
popd
endlocal
exit /B
After execution of this batch file also I am getting continuous errors from ffmpeg command as
File not found
File not found.
If you can't believe my words try to create an empty file with file name containing chinise characters in windows command prompt or Linux terminal emulator using command like touch. Definitely you will fail to create.
Even if you can't believe my words try to download or copy any file from internet with file name containing chinise characters. After that try to navigate to the directory downloaded in windows power shell and issue the ls command and definitely you are not going to see file you downloaded.
I have searched web for " unicode support in command prompt " " unicode support in terminal emulator " but I have not found any suitable solution.
Can anyone of you suggest how to work with command line tools like ffmpeg, touch and using these commands in shell scripting or windows command prompt and windows power shell.
Regards,
Rupesh.