Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Multimedia
  • Search

How embed subtitle in movie's file with avidemux?

Help with creation, editing, or playback of sounds, images, or video. Amarok, audacious, mplayer, grip, cdparanoia and anything else that makes a sound or plays a video.
Post Reply
Advanced search
17 posts • Page 1 of 1
Author
Message
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

How embed subtitle in movie's file with avidemux?

  • Quote

Post by pmam » Mon Apr 06, 2015 8:48 am

I want to stream movies from PC to TV -
I have DLNA and also can do it by nfs/mounting from sat receiver to PC through LAN, and it works ok.
However, I do not have any feature of those two applications (DLNA & NFS/mounting), that enables adding subtitles to movies.
So, I need application that can embed subtitle and creates new movie's file (with subtitle included).
Last edited by pmam on Mon Apr 20, 2015 10:47 am, edited 3 times in total.
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
krinn
Watchman
Watchman
User avatar
Posts: 7476
Joined: Fri May 02, 2003 6:14 am

  • Quote

Post by krinn » Mon Apr 06, 2015 2:58 pm

you can do that with:
mencoder -o outfile infile -sub subtitle.srt -subcp utf8 -font fontfile -ovc codec
fontfile sample: /usr/share/fonts/dejavu/DejaVuSans.ttf

what is problematic?
you have many format for subtitle file, one of them is that subtitle aren't even text, but picture holding the text
so you need to extract the subtitle first, and it depend on the container and the subtitle format they use.
for mkv you can look at media-video/mkvtoolnix that have an mkvextract tool to do that.
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Tue Apr 07, 2015 2:47 pm

krinn,

I see that in order to have mencoder, need to re-emerge mplayer with 'encode' USE flag - Right?
In general, I use text subtitles - I mean - I can open it with text editors and see the content -
so hope, no need to extract.But I am quite surprised to see that there is no such GUI tool,
that enables to edit the movie file and embed subtitle -
long ago I used to do it with windows and there were many of that.
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

  • Quote

Post by Apheus » Tue Apr 07, 2015 2:57 pm

I did it one time with avidemux. But that was long ago.

media-video/avidemux.

Open the movie file. In "Video" section: Change video output from "Copy" to your prefered encoder. In "Filters" there should be a filter to add a subtitle from a .srt file to the movie. Select and configure the filter. And "Save" asks for a filename and transcodes the movie.
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Tue Apr 07, 2015 5:27 pm

Apheus Hi,

I installed media-video/avidemux and it looks very nice tool,
but there is nothing in "Filters" for subtitle - it is empty??
BTW: If I choose "copy" I guess it keeps the original encoder?

Thanks
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

  • Quote

Post by Apheus » Tue Apr 07, 2015 5:54 pm

pmam wrote:there is nothing in "Filters" for subtitle - it is empty?
After loading an input file, and changing "Video output" to "Mpeg4-ASP (ff)", I see one filter in the category "Subtitles": "SSA/ASS/SRT: Hardcode ass/ssa/srt subtitles using libass".

I have the use flag "libass" set globally, maybe you need it. My use flags for relevant packages:

Code: Select all

[ebuild   R    ] media-video/ffmpeg-1.2.6-r1  USE="X aac alsa amr bluray bzip2 encode fontconfig gnutls gsm hardcoded-tables iconv jpeg2k libass libcaca modplug mp3 network openal opus pic schroedinger sdl speex theora threads truetype vdpau vorbis vpx x264 xvid zlib -aacplus (-altivec) -cdio (-celt) -cpudetection -debug -doc -examples -faac -fdk -flite -frei0r -iec61883 -ieee1394 -jack -libsoxr -libv4l (-neon) -openssl -oss -pulseaudio -rtmp -static-libs {-test} -twolame -v4l -vaapi (-vis) (-bindist%)" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="mmx mmxext ssse3 -3dnow -3dnowext -avx" FFTOOLS="aviocat cws2fws ffescape ffeval fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart trasher" 0 KiB

[ebuild   R   ~] media-video/avidemux-2.6.8:2.6  USE="nls opengl qt4 sdl xv -debug -vaapi -vdpau" LINGUAS="de -ca -cs -el -es -fr -it -ja -pt_BR -ru -sr -sr@latin -tr" VIDEO_CARDS="-fglrx"

[ebuild   R   ~] media-libs/avidemux-core-2.6.8:2.6  USE="nls sdl xv -debug (-system-ffmpeg) -vaapi -vdpau" VIDEO_CARDS="-fglrx" 0 KiB

[ebuild   R   ~] media-libs/avidemux-plugins-2.6.8:2.6  USE="a52 aac alsa amr dts fontconfig lame opengl qt4 truetype vorbis vpx x264 xv xvid -aften -debug -fribidi -jack -libsamplerate -oss -pulseaudio -twolame -vdpau" CPU_FLAGS_X86="mmx" PYTHON_TARGETS="python2_7" 0 KiB
My guess is you have to recompile media-video/ffmpeg with USE="libass".
pmam wrote:If I choose "copy" I guess it keeps the original encoder?
You cannot embed subtitles without reencoding, so "copy" is not an option here. It means "copy the video part of the demuxed stream unmodified", which is i.e. for adding an audio track.
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Wed Apr 08, 2015 9:40 am

Apheus,

I added USE="libass" globally (to make.conf) and updated the system but still category "Subtitles" is empty.
I wonder if need to add all your USE flags, or can you please advise particular ones?
BTW: How to print like your output that shows use flags for relevant packages?
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

  • Quote

Post by Apheus » Wed Apr 08, 2015 9:55 am

pmam wrote:I wonder if need to add all your USE flags, or you can advise particular ones?
The only particular one which came to my mind was "libass". Other than that, I have no idea.
BTW: How to print like your output that shows use flags for relevant packages?
Just ask emerge for a simulated remerge of the package with "verbose" option:

Code: Select all

emerge -pv media-video/ffmpeg
Bonus points for copying that to the forums with the colors of set/unset useflags. I think I saw this once but I don't know how to do it.
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Wed Apr 08, 2015 10:27 am

Apheus,

Here my data - some USE flags missing, comparing to yours - need to check...
Also do not know if to add them globally or by package.use?
Hope someone can tell...

Code: Select all

[ebuild   R   ~] media-video/ffmpeg-2.6.1:0/54.56.56  USE="X aac alsa bzip2 encode gpl hardcoded-tables iconv libass mp3 network opengl postproc sdl threads truetype vorbis x264 xcb xvid zlib -aacplus (-altivec) -amr -amrenc (-armv5te) (-armv6) (-armv6t2) (-armvfp) -bluray -bs2b -cdio -celt -cpudetection -debug -doc -examples -faac -fdk -flite -fontconfig -frei0r -fribidi -gme -gnutls -gsm -iec61883 -ieee1394 -jack -jpeg2k -ladspa -libcaca -libsoxr -libv4l -lzma (-mipsdspr1) (-mipsdspr2) (-mipsfpu) -modplug (-neon) -openal -openssl -opus -oss -pic -pulseaudio -quvi -rtmp -samba -schroedinger -speex -ssh -static-libs {-test} -theora -twolame -v4l -vaapi -vdpau -vpx -wavpack -webp -x265 -zvbi" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3 -3dnow -3dnowext -avx -avx2 -fma3 -fma4 -sse4_1 -sse4_2 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart trasher" 0 KiB

Code: Select all

[ebuild   R   ~] media-video/avidemux-2.6.8:2.6  USE="nls opengl qt4 sdl xv -debug -vaapi -vdpau" LINGUAS="-ca -cs -de -el -es -fr -it -ja -pt_BR -ru -sr -sr@latin -tr" VIDEO_CARDS="-fglrx" 0 KiB

Code: Select all

[ebuild   R   ~] media-libs/avidemux-core-2.6.8:2.6  USE="nls sdl xv -debug (-system-ffmpeg) -vaapi -vdpau" VIDEO_CARDS="-fglrx" 0 KiB

Code: Select all

[ebuild   R   ~] media-libs/avidemux-plugins-2.6.8:2.6  USE="a52 aac alsa dts opengl qt4 truetype vorbis x264 xv xvid -aften -amr -debug -fontconfig -fribidi -jack -lame -libsamplerate -oss -pulseaudio -twolame -vdpau -vpx" CPU_FLAGS_X86="mmx" PYTHON_TARGETS="python2_7" 0 KiB
Thanks
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Sun Apr 19, 2015 8:43 pm

Apheus,

I added the two packages - media-libs/avidemux-core, media-libs/avidemux-plugins -
they do not installed by default during installing media-video/avidemux -
and followed your USE flags that you posted her - in particular USE flags of media-libs/avidemux-plugins -
and now I have SSA/ASS/SRT in subtitle filters :)
Now I am going to see how it embed subtitles...

Thanks
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Mon Apr 20, 2015 10:46 am

Now I see that after the process of avidemux ( I can see it with 'Preview', as well),
I get subtitle in gibberish - the .srt file is ok with my local language.
I tried to add some USE flags but still not ok.
Please advise how to add local fonts?
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

  • Quote

Post by Apheus » Mon Apr 20, 2015 11:49 am

I think the combination of use flags "libass" and "fontconfig" for media-video/ffmpeg was the needed bit for the filters to become visible. I'm surprised that there is no font selection in the filter's settings, I did not know that. Unfortunately, I do not know what font avidemux uses and if there is some indirect way to configure it...
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Mon Apr 20, 2015 6:34 pm

Apheus,
I think the combination of use flags "libass" and "fontconfig" for media-video/ffmpeg
was the needed bit for the filters to become visible.
I am not sure about it - I added many USE flags, also to media-libs/avidemux-plugins, and I do not remember exactly...

It is really surprised to see that there is no fonts selection - it does not make sense and I guess there is some way to do it -
The main developer of Gentoo's avidemux called Tom Wijsman, and I used to see him response to topics in this Gentoo's forum,
but recently have not seen any post of him - hope he is around and will reply to this topic...

Thanks
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Mon Apr 20, 2015 8:41 pm

Maybe Jubler can help to fix the subtitle fonts for avidemux,
but I get this requirement and do not know if to accept or if it can cause any damage?

Code: Select all

 Oracle requires you to download the needed files manually after
 * accepting their license through a javascript capable web browser.
 * 
 * Download the following files:
 *   jdk-7u80-linux-x64.tar.gz
 * at 'http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html#jdk-7u80-oth-JPR'
 * and move them to '/usr/portage/distfiles'
 * 
 * If the above mentioned urls do not point to the correct version anymore,
 * please download the files from Oracle's java download archive:
 * 
 *    http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u80-oth-JPR
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
Apheus
Guru
Guru
Posts: 422
Joined: Sat Jul 12, 2008 7:16 pm

  • Quote

Post by Apheus » Mon Apr 20, 2015 8:55 pm

It is in portage: =dev-java/oracle-jdk-bin-1.7.0.80. The license forbids mirroring by gentoo infrastucture, but you can download it from oracle, put it into /usr/portage/distfiles and then:

Code: Select all

emerge dev-java/oracle-jdk-bin:1.7
But I don't see how a java program can help with the subtitle rendering in avidemux?
Top
pmam
Veteran
Veteran
Posts: 1145
Joined: Mon Dec 30, 2013 8:26 am

  • Quote

Post by pmam » Fri May 01, 2015 8:22 am

Jubler did not help so I returned to krinn tip and embedded the subtitle with the right font with mencoder like this command:

Code: Select all

mencoder -o outfile infile -sub subfile -subcp cp1255 -font /usr/share/fonts/dejavu/DejaVuSans.ttf -oac mp3lame 
-ovc xvid -lameopts cbr:br=128 -ovc xvid -xvidencopts pass=1

I get quite big output file but it works...

Anyway, I would prefer gui and hope someone knows how to add fonts to avidemux or with other gui application??
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Top
v_andal
Guru
Guru
Posts: 549
Joined: Tue Aug 26, 2008 4:25 pm
Location: Germany

  • Quote

Post by v_andal » Mon May 04, 2015 8:06 am

I've tried avidemux in the past, but it didn't work for me somehow. Now I'm using Handbrake and find it to be an interesting alternative. As far as I can see, it does support subtitles addition.
Top
Post Reply

17 posts • Page 1 of 1

Return to “Multimedia”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic