<p>It appears that the subtitles file did not have <strong><code>--&gt;</code></strong> but a <strong><code>–&gt;</code></strong> with the <strong><code>–</code></strong> corresponding to the <em><a href="http://www.getitwriteonline.com/archive/091502enem.htm" rel="nofollow">en dash</a></em> that was placed in the file, which was edited by hand externally. It seems like the <em>en dash</em> sign was assigned to typing <kbd>-</kbd><kbd>-</kbd> in Mac TextEdit <em>(the functionality can be disabled in preferences)</em>.</p>

CC BY-SA 3.0
2016-01-31T11:44:09.687Z
2016-02-01T10:12:50.287Z
2016-02-01T10:12:50.287Z
Konrad
<p>I would like to hardcode subtitles using <strong>FFmpeg</strong>, I'm trying to do this using the following command:</p>

<pre><code>ffmpeg -i grdedFinal.mov -vf subtitles=portSbs.srt gradedFinalwithSubs.mov
</code></pre>

<p>which returns the following error:</p>

<pre><code>ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'grdedFinal.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2015-02-28 14:04:35
  Duration: 00:18:09.84, start: 0.000000, bitrate: 11270 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576, 9728 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
      encoder         : H.264
[Parsed_subtitles_0 @ 0x7fbeaa50bca0] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.1.3 (COMPLEX)
[Parsed_subtitles_0 @ 0x7fbeaa50bca0] Unable to open portSbs.srt
[AVFilterGraph @ 0x7fbeaa50ba80] Error initializing filter 'subtitles' with args 'portSbs.srt'
Error opening filters!
</code></pre>

<hr>

<p>I followed <a href="http://www.renevolution.com/how-to-install-ffmpeg-on-mac-os-x/" rel="nofollow">those instructions</a> when installing <strong>FFmpeg</strong>:</p>

<pre><code>brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools
</code></pre>

<hr>

<h1>Feedback following comments</h1>

<h2>1st suggestion</h2>

<p>Judging by the error message, it appears that something may be wrong with the <strong>SRT</strong> file, isn't it?</p>

<pre><code>me-bash-3.2:/Volumes/Duracell$ ffmpeg -i gradedFinal.mov -i portSbs.srt -vf subtitles gradedFinalwithSubs.mov
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'gradedFinal.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2015-02-28 14:04:35
  Duration: 00:18:09.84, start: 0.000000, bitrate: 11267 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576, 9728 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
      encoder         : H.264
portSbs.srt: Invalid data found when processing input
</code></pre>

<h2>Subtitle file</h2>

<p>The subtitle file looks like that (extract):</p>

<pre><code>1
00:02:25,000 —&gt; 00:02:29,000
Falei com um homem que me disse que eu estava a usar
demasiada roupa


2
00:02:29,000 –&gt; 00:02:31,000
Que com isso devo querer proteger-me de alguma coisa
</code></pre>

<h3>File info</h3>

<pre><code>me-bash-3.2:/Volumes/Duracell$ file -I portSbs.srt
portSbs.srt: text/plain; charset=utf-8
</code></pre>

<h2>2nd, checking filter</h2>

<pre><code>me-bash-3.2:/Volumes/Duracell$ ffmpeg -help filter=subtitles
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Filter subtitles
  Render text subtitles onto input video using the libass library.
    Inputs:
       #0: default (video)
    Outputs:
       #0: default (video)
subtitles AVOptions:
  filename          &lt;string&gt;     ..FV.... set the filename of file to read
  f                 &lt;string&gt;     ..FV.... set the filename of file to read
  original_size     &lt;image_size&gt; ..FV.... set the size of the original video (used to scale fonts)
  fontsdir          &lt;string&gt;     ..FV.... set the directory containing the fonts to read
  charenc           &lt;string&gt;     ..FV.... set input character encoding
  stream_index      &lt;int&gt;        ..FV.... set stream index (from -1 to INT_MAX) (default -1)
  si                &lt;int&gt;        ..FV.... set stream index (from -1 to INT_MAX) (default -1)
  force_style       &lt;string&gt;     ..FV.... force subtitle style
</code></pre>

CC BY-SA 3.0
2016-01-31T04:53:42.973Z
It says, "Unable to open portSbs.srt". Recheck the filename, and refer to it with the full path. If that doesn't work, try with another (known good) SRT.
Gyan
CC BY-SA 3.0
2016-01-31T08:26:34.587Z
@Mulvya Thanks very much for showing interest, I tried passing the full path `/Volumes/Duracell/portSbs.srt` but I arrived at the same error message. The file appears to be not damaged, I can open and edit it in a text editor.
Konrad
CC BY-SA 3.0
2016-01-31T09:01:14.807Z
Run `ffmpeg -i grdedFinal.mov -i portSbs.srt -vf subtitles gradedFinalwithSubs.mov` and paste the console output into your question.
Gyan
CC BY-SA 3.0
2016-01-31T10:04:22.960Z
@Mulvya Thanks very much for the helpful comments, I pasted additional output.
Konrad
CC BY-SA 3.0
2016-01-31T11:05:30.817Z
Let's confirm that subtitle filter is compiled in: `ffmpeg -help filter=subtitles` <-- does that say `unknown filter`?
Gyan
CC BY-SA 3.0
2016-01-31T11:13:08.520Z
@Mulvya Thanks for the continued interest in my problem, I just tested the command and it appears that the filter is compiled.
Konrad
CC BY-SA 3.0
2016-02-04T05:45:18.640Z
Can I suggest TextWrangler for editing these kinds of files on the Mac to avoid that kind of nastiness.
stib
CC BY-SA 3.0
2016-02-04T06:43:35.880Z
@stib The file was edited externally, I mostly use Atom or TW for text editing.
Konrad
<ffmpeg><conversion><mac><subtitles>
Unable to hardcode subtitles in FFmpeg on Mac to mov
Konrad
# Unable to hardcode subtitles in FFmpeg on Mac to mov

(Asked by: username_0 on 2016-01-30)

I would like to hardcode subtitles using FFmpeg, I'm trying to do this using the following command:
ffmpeg -i grdedFinal.mov -vf subtitles=portSbs.srt gradedFinalwithSubs.mov

which returns the following error:
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'grdedFinal.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2015-02-28 14:04:35
  Duration: 00:18:09.84, start: 0.000000, bitrate: 11270 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576, 9728 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
      encoder         : H.264
[Parsed_subtitles_0 @ 0x7fbeaa50bca0] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.1.3 (COMPLEX)
[Parsed_subtitles_0 @ 0x7fbeaa50bca0] Unable to open portSbs.srt
[AVFilterGraph @ 0x7fbeaa50ba80] Error initializing filter 'subtitles' with args 'portSbs.srt'
Error opening filters!


I followed those instructions when installing FFmpeg:
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools


Feedback following comments
1st suggestion
Judging by the error message, it appears that something may be wrong with the SRT file, isn't it?
me-bash-3.2:/Volumes/Duracell$ ffmpeg -i gradedFinal.mov -i portSbs.srt -vf subtitles gradedFinalwithSubs.mov
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'gradedFinal.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2015-02-28 14:04:35
  Duration: 00:18:09.84, start: 0.000000, bitrate: 11267 kb/s
    Stream #0:0(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1024x576, 9728 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc (default)
    Metadata:
      creation_time   : 2015-02-28 14:04:35
      handler_name    : Apple Alias Data Handler
      encoder         : H.264
portSbs.srt: Invalid data found when processing input

Subtitle file
The subtitle file looks like that (extract):
1
00:02:25,000 —> 00:02:29,000
Falei com um homem que me disse que eu estava a usar
demasiada roupa


2
00:02:29,000 –> 00:02:31,000
Que com isso devo querer proteger-me de alguma coisa

File info
me-bash-3.2:/Volumes/Duracell$ file -I portSbs.srt
portSbs.srt: text/plain; charset=utf-8

2nd, checking filter
me-bash-3.2:/Volumes/Duracell$ ffmpeg -help filter=subtitles
ffmpeg version 2.8.5 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.5 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Filter subtitles
  Render text subtitles onto input video using the libass library.
    Inputs:
       #0: default (video)
    Outputs:
       #0: default (video)
subtitles AVOptions:
  filename               ..FV.... set the filename of file to read
  f                      ..FV.... set the filename of file to read
  original_size      ..FV.... set the size of the original video (used to scale fonts)
  fontsdir               ..FV.... set the directory containing the fonts to read
  charenc                ..FV.... set input character encoding
  stream_index              ..FV.... set stream index (from -1 to INT_MAX) (default -1)
  si                        ..FV.... set stream index (from -1 to INT_MAX) (default -1)
  force_style            ..FV.... force subtitle style

**Tags:** ffmpeg, conversion, mac, subtitles

> **Comments:**
> **username_1**: It says, "Unable to open portSbs.srt". Recheck the filename, and refer to it with the full path. If that doesn't work, try with another (known good) SRT.  
> **username_0**: @Mulvya Thanks very much for showing interest, I tried passing the full path `/Volumes/Duracell/portSbs.srt` but I arrived at the same error message. The file appears to be not damaged, I can open and edit it in a text editor.  
> **username_1**: Run `ffmpeg -i grdedFinal.mov -i portSbs.srt -vf subtitles gradedFinalwithSubs.mov` and paste the console output into your question.  
> **username_0**: @Mulvya Thanks very much for the helpful comments, I pasted additional output.  
> **username_1**: Let's confirm that subtitle filter is compiled in: `ffmpeg -help filter=subtitles` <-- does that say `unknown filter`?  
> **username_0**: @Mulvya Thanks for the continued interest in my problem, I just tested the command and it appears that the filter is compiled.  
> **username_2**: Can I suggest TextWrangler for editing these kinds of files on the Mac to avoid that kind of nastiness.  
> **username_0**: @username_2 The file was edited externally, I mostly use Atom or TW for text editing.  

---

## 1 answers

### Answer by username_0 on 2016-01-31. Score: 2

It appears that the subtitles file did not have **`-->`** but a **`–>`** with the **`–`** corresponding to the *[en dash](http://www.getitwriteonline.com/archive/091502enem.htm)* that was placed in the file, which was edited by hand externally. It seems like the *en dash* sign was assigned to typing `-``-` in Mac TextEdit *(the functionality can be disabled in preferences)*.


---

