-
Notifications
You must be signed in to change notification settings - Fork 32
Subtitles and mp4 metadata
Mark Van den Borre edited this page Dec 28, 2017
·
11 revisions
To embed non-subtitle metadata (like the title, penta id, ...) into an mp4 file:
AtomicParsley test.mp4 --TVShowName "FOSDEM" --TVEpisodeNum 1234 --TVSeason 18 --overWrite```
Or use mp4v2-utils:
```apt-get install mp4v2-utils
mp4tags -album 'FOSDEM 2018' -song 'Embedding mp4 tags in blah using llvm' -season 18 -episode 1234 -year 2018 -longdesc 'Ik heb eerbied voor jouw grijze haaaaareeeeen. Ze beschermen je lieve geziiiiiicht.' seektest.mp4```
Then check if metadata have been recorded into the mp4 correctly:
```AtomicParsley test.mp4 -t```
## Web based playback with subtitles? vtt format
Vtt is the w3c standard format for web based subtitle playback.
* One can export subtitles in .vtt directly from amara.org.
* Ffmpeg can convert existing subtitles to .vtt:
```ffmpeg -i test.srt test.vtt```
## Web based playback with subtitles? Use javascript
In theory, html5 should support subtitle track playback without any javascript. In practice, there are still a few rough edges.
We use the clappr java script based player for streaming. Clappr has quite good builtin support for subtitle playback. An example:
Embedding a subtitle track into an mp4 file is easy.
ffmpeg -i infile.mp4 -i infile.srt -c copy -c:s mov_text outfile.mp4
...or more explicitly:
ffmpeg -i infile.mp4 -i infile.srt -c:v copy -c:a copy -c:s mov_text outfile.mp4