Hallo Leute,
ich habe hier ein Problem mit Datei-/Pfadnamen. Und zwar habe ich ein Batchfile geschrieben, was mir Videofiles und Ordner mit EinzelbildSequenzen komprimiert.
Funktioniert soweit auch ganz gut. Bei den avi files darf jedoch nur der Pfad Leerzeichen haben, sobald der Dateiname ein Leerzeichen hat, funktioniert es nicht mehr. Setzte ich die fehlerhaften Pfad Variablen in """ funktionieren dann die Dateien mit Leerzeichen, aber die ohne funktionieren nicht mehr.
Habt hier eine Idee, wie ich das hin bekommen kann?
Hier mal ein Code Ausschnitt:
Code
if "%~x1" == "" GOTO folder
rem File Compression -------------------------------
if exist %~n1_info.tmp del %~n1_info.tmp
if exist %~n1_tmp.avs del %~n1_tmp.avs
if exist %~n1_video.h264 del %~n1_video.h264
if exist %~n1_audio.aac del %~n1_audio.aac
if exist %~n1_x264.mp4 del %~n1_x264.mp4
chcp 1252
if %~x1 == .avi (
@echo AVISource^( %1 ^).FlipVertical^(^) >> %~n1_tmp.avs
set infile="%~n1_tmp.avs"
) else (
set infile=%1
)
chcp 850
if not "%fps%" == "" GOTO vid
Z:\PROGRAMME\__GlobalTools\CMDTools\mediainfo --Inform="Video;%%FrameRate%%" %1 >> %~n1_info.tmp
for /f %%a in (%~n1_info.tmp) do set fps=%%a
:vid
Z:\PROGRAMME\__GlobalTools\CMDTools\avconv.exe -v -10 -y -i %infile% -acodec aac -ab 160k -strict experimental -vn %~n1_audio.aac
Z:\PROGRAMME\__GlobalTools\CMDTools\avconv.exe -i %infile% -vcodec libx264 -crf %quality% -r %fps% -pix_fmt yuv420p -profile main -coder 1 -flags +loop+mv4 -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method umh -subq 8 -me_range 16 -g %GOPSize% -keyint_min 5 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 2 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 3 -refs 4 -directpred 3 -trellis 1 -flags2 +wpred+mixed_refs+dct8x8+fastpskip -an -threads 0 -y %~n1_video.h264
Z:\PROGRAMME\__GlobalTools\CMDTools\mp4creator -create=%~n1_video.h264 -r %fps% %~n1_x264.mp4
Z:\PROGRAMME\__GlobalTools\CMDTools\mp4creator -create=%~n1_audio.aac %~n1_x264.mp4
if exist %~n1_info.tmp del %~n1_info.tmp
if exist %~n1_tmp.avs del %~n1_tmp.avs
if exist %~n1_video.h264 del %~n1_video.h264
if exist %~n1_audio.aac del %~n1_audio.aac
GOTO end
Alles anzeigen