mlsmithjr/transcoder

Issues with filenames containing spaces

Opened this issue · 3 comments

Hi there,
I'm having some issues getting a clustered setup working, when using files which contain spaces, both streamed and SSH.

Server: Ubuntu 18.04
Encoding Client: Windows 10, Native SSH (not WSL), Streamed config or Mapped Drive config

With streaming, it successfully copies the file over and then reports:

dalgibbard@server:~$ pytranscoder -c home -p hevc_cuda /data/Videos/Films/Short\ Circuit\ 2\ \(1988\)/Short\ Circuit\ 2\ \(1988\)\ Remux-1080p.mkv
----------------------------------------
Host     : fullsteam (streaming)
Filename : Short Circuit 2 (1988) Remux-1080p.mkv
Profile  : hevc_cuda
ssh      : /usr/bin/ssh dalgi@192.168.0.80 -y -hwaccel cuvid -c:v h264_cuvid -i c:\temp\Short Circuit 2 (1988) Remux-1080p.mkv -preset slow -c:a copy -c:s copy -profile:v main -f matroska -cq:v 23 -rc vbr_hq -rc-lookahead 32 -b:v 1000K -maxrate:v 8M -c:v hevc_nvenc -map 0:0 -map 0:1 -map 0:2 c:\temp\Short Circuit 2 (1988) Remux-1080p.mkv.tmp

(fullsteam):  scp /data/Videos/Films/Short Circuit 2 (1988)/Short Circuit 2 (1988) Remux-1080p.mkv dalgi@192.168.0.80:/c:\temp
(fullsteam):  Unknown error encoding on remote

Running the command against the successfully copied file manually gives:

C:\Users\dalgi>ffmpeg -y -hwaccel cuvid -c:v h264_cuvid -i c:\temp\Short Circuit 2 (1988) Remux-1080p.mkv -preset slow -c:a copy -c:s copy -profile:v main -f matroska -cq:v 23 -rc vbr_hq -rc-lookahead 32 -b:v 1000K -maxrate:v 8M -c:v hevc_nvenc -map 0:0 -map 0:1 -map 0:2 c:\temp\Short Circuit 2 (1988) Remux-1080p.mkv.tmp
ffmpeg version git-2019-11-26-59d264b Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20191125
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 36.100 / 56. 36.100
  libavcodec     58. 62.100 / 58. 62.100
  libavformat    58. 35.100 / 58. 35.100
  libavdevice    58.  9.101 / 58.  9.101
  libavfilter     7. 67.100 /  7. 67.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
c:\temp\Short: No such file or directory

With the mapped drive it's a similar story, seems the quotes are being passed in, but not escaped, so they're dropped by the client?

The plot thickens; i've tried dropping the spaces when using the mount option, and it's saying the file doesn't exist, but if i take that exact path and do a dir or just dump it into Explorer it opens up fine?:

$ pytranscoder -c home -p hevc_cuda /data/Videos/Films/Casino.Royale.2006/Casino.Royale.2006.HDTV-720p.mkv
----------------------------------------
Host     : fullsteam (mounted)
Filename : Z:\Videos\Films\Casino.Royale.2006\Casino.Royale.2006.HDTV-720p.mkv
Profile  : hevc_cuda
ffmeg    : -y -hwaccel cuvid -c:v h264_cuvid -i "Z:\Videos\Films\Casino.Royale.2006\Casino.Royale.2006.HDTV-720p.mkv" -preset slow -c:a copy -c:s copy -profile:v main -f matroska -cq:v 23 -rc vbr_hq -rc-lookahead 32 -b:v 1000K -maxrate:v 8M -c:v hevc_nvenc "Z:\Videos\Films\Casino.Royale.2006\Casino.Royale.2006.HDTV-720p.mkv.tmp"

(fullsteam):  Did not complete normally: /usr/bin/ssh dalgi@192.168.0.80 C:/ffmpeg/ffmpeg-20191126-59d264b-win64-static/bin/ffmpeg.exe -y -hwaccel cuvid -c:v h264_cuvid -i "Z:\Videos\Films\Casino.Royale.2006\Casino.Royale.2006.HDTV-720p.mkv" -preset slow -c:a copy -c:s copy -profile:v main -f matroska -cq:v 23 -rc vbr_hq -rc-lookahead 32 -b:v 1000K -maxrate:v 8M -c:v hevc_nvenc "Z:\Videos\Films\Casino.Royale.2006\Casino.Royale.2006.HDTV-720p.mkv.tmp"
(fullsteam):  Output can be found in /tmp/pytranscoder-fullsteam-424.log

$ cat /tmp/pytranscoder-fullsteam-424.log
ffmpeg version git-2019-11-26-59d264b Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20191125
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 36.100 / 56. 36.100
  libavcodec     58. 62.100 / 58. 62.100
  libavformat    58. 35.100 / 58. 35.100
  libavdevice    58.  9.101 / 58.  9.101
  libavfilter     7. 67.100 /  7. 67.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Z:\Videos\Films\Casino.Royale.2006\Casino.Royale.2006.HDTV-720p.mkv: No such file or directory

Confirmed however that removing the spaces, and using streaming does work.