Hi, I'm running Ubuntu 11.04 and I have ffmpeg compiled and installed.
I have some MKV's with .ass subs (with embedded fonts) and I need to convert them to mp4. I'd prefer to do it in ffmpeg because I know the syntax well... anyway...
I want to hardsub the mp4s, so I want to know what would be the best way to do that through Ubuntu 11.04 and ffmpeg is and what other programs I'll need to do it.
+ Reply to Thread
Results 1 to 3 of 3
-
-
Recently found out how to get this to work.
ffmpeg often doesn't have libass support built in by default. I had to rebuild ffmpeg. You can check whether you need to do this by invoking ffmpeg with no arguments. It should print the list of configure args used when compiling. If --enable-libass isn't there, you probably need to rebuild. Arguments listed at the end of this post.
mkvextract (part of mkvtoolnix) is needed to extract the subtitle files. Unfortunately ffmpeg doesn't seem to be able to handle internal subtitle and font files directly in this context, it can only accept an external file.
Here are the scripts I use to encode every mkv in the present directory to hardsubbed mp4 for playing on the PS3:
file: extract_subs.sh
Code:#!/bin/bash for i in *.mkv do mkvextract tracks "${i}" 2:"${i}".ass done
Code:#!/bin/bash for i in *.mkv do ffmpeg -i "${i}" -sn -c:v libx264 -x264opts crf=20 -filter ass="${i}".ass -c:a aac -strict experimental "${i}".mp4 done
The extract_subs script assumes that the subtitle stream is the third one (labelled 2, counting from 0). If you find a set of files with the subtitle stream first (use mkvinfo to check) then the mkvextract command would be like this:
mkvextract tracks "${i}" 0:"${i}".ass
Here is the complete set of configure args used when building my ffmpeg (note --enable-libass):
./configure \
--prefix=/usr \
--enable-gpl \
--enable-libfaac \
--enable-libmp3lame \
--enable-libtheora \
--enable-libvorbis \
--enable-libx264 \
--enable-nonfree \
--enable-x11grab \
--enable-shared \
--enable-libass \
--enable-libxvid \
--enable-libvpx \
--enable-libgsm \
--enable-libspeex \
--enable-x11grab \
--enable-libopencore_amrnb \
--enable-libopencore_amrwb \
--enable-libschroedinger \
--enable-libopenjpeg \
--enable-librtmp \
--enable-libpulse \
--enable-version3 \
--enable-runtime-cpudetect \
--disable-debug --disable-static
Similar Threads
-
External subs don't play correctly with Anime .mkv with embedded subs (.ass
By Reveur in forum Software PlayingReplies: 1Last Post: 8th Nov 2011, 02:20 -
Making Ass MP4 (Or MKV) Hardsubs
By N-TG in forum SubtitleReplies: 1Last Post: 16th Nov 2010, 03:54 -
MKV with .ass or .ssa subs into mp4 for ipod
By lilly1991 in forum Newbie / General discussionsReplies: 0Last Post: 27th Jul 2010, 09:57 -
Converting MKV to MP4 (m4v) for iPod Touch with ASS subtitles [HELP]
By The_Jelly in forum Video ConversionReplies: 3Last Post: 14th Jan 2010, 00:17