Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(’The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

May 20, 2007

Step 3(a): Merging(Hardcoding) Subtitles With AVI(DivX/XviD) Files Using AviRecomp

Filed under: Video — tabrez @ 2:46 pm

When converting a movie from a DVD to the AVI(DivX/XviD) format, the subtitles can be included in the output file by selecting appropriate settings from the conversion software(AutoGK, SimpleDivX, #1 DVD Ripper). Some applications hardcode the subtitles in the output file whereas some also allow external subtitle files to be created. But if you have obtained the AVI files from a different source than a DVD(a friend, Internet etc) then you have to search for suitable subtitles for the movie on the Internet and use a media player that supports displaying the subtitles from external files to play it. VLC Media Player is one such application that supports displaying subtitles in various formats(SRT, SUB etc). One usage scenario is described below:

  1. You own the DVD of a film but don’t have the patience to use a software to convert it, along with the subtitles, to the compressed AVI format. Or perhaps the DVD doesn’t include the subtitles for the language of your preference at all. In such cases, you can search and download the subtitle files for the film from the Internet. Here are some options to search for the subtitles in various languages:
    http://www.divxsubtitles.net/
    http://www.opensubtitles.org/
    http://subscene.com/
  2. Now you can view the film with the subtitles that you have downloaded using a media player like VLC Media Player or Windows Media Player. Keep the AVI file and the subtitle file(s) in the same folder and give them the same base file name(they will have different file extensions). If you run the AVI file now, the subtitles will automatically be displayed. You can also manually load a subtitle in VLC Media Player from the ‘Open File’ dialog box.
    Open Media with Subtitles in VLC Player
  3. The above method works fine as long as you play the movies on your computer using a decent media player. If you would rather watch it on your favourite handheld device(iPod, Creative Vision:M, Nokia N800, Sony PSP, etc), its media player may not support displaying subtitles from external files. In that case, the only option you have is to hardcode the subtitles in the AVI file itself. To do this, I use the Free software AviRecomp, and the procedure to merge/hardcode the subtitles with the AVI file using it is given below. Once the subtitles are thus merged, the resultant AVI file can then be converted to the native formats of different handheld devices(topic of next post).

Merging Subtitles with AVI Files Using AviRecomp

  1. This is how the example video looks before it is merged with the subtitles(English). We will see the result of the merge process at the end of the procedure to see the difference.
    Video without Subtitles
  2. After installing AviRecomp on the computer, start it from the Start menu. The main window of the application looks like this.
    Main Window of AviRecomp
  3. In the “Source & Output” tab, click the “Open AVI” button and select the AVI file you want to merge the subtitles with. Then click the “Save AVI” button and select a folder where you want to store the output file. Finally, select the size of the output file(if you don’t want to recompress/resize, specify the same size as that of the original file - this will be faster) in “New AVI Size” drop-down box.
    Select Output Path and Size in AviRecomp
  4. Go to the next tab by clicking on “Additions” button and check the “Enable/Disable” checkbox in the “Subtitles” panel. Then click the “Load Subtitles” button and select the subtitle file that you have downloaded from the Internet(see Step 2 at the top of the post).
    Load Subtitles in AviRecomp
  5. In the “Settings” tab, you can specify various settings such as the priority with which AviRecomp should be run, if the temporary files or the source file should be deleted at the end etc.
    Set Process Priority of AviRecomp
  6. Go to the last tab by clicking the “Queue” button and click the button “Add to Queue” to add this job the to queue. The above steps can now be repeated with more AVI files and added to the queue if multiple merge operations are needed to be performed.
    Multple jobs can be added in AviRecomp
  7. When ready, click the “Start” button to start the merge process. The status will change from “Waiting…” to “Running…” state as a result.
    Subtitle Merge Job Running in AviRecomp
    To see the % progress of the merge process, look at the title bar of AviRecomp in the Windows taskbar.
    Job Progress in AviRecomp
  8. After the merge process is finished, go to the folder where the output file is created(as selected in Step 3) and play the file. The subtitles should now be hardcoded into the file. This file can now be converted to the native formats of different handheld devices to enjoy viewing them along with the subtitles.
    Video after Merging Subtitles using AviRecomp

You can search for a different application that is specifically made for merging the subtitles with the video files but AviRecomp can be used for purposes other than mere subtitle merging. It also allows adding black borders to the movie and place the subtitles on them. It also installs many other useful video related software like VirtualDub, AviSynth, VobSub etc, that it uses for doing its own job, making it unnecessary to download and install these software separately. AviRecomp is a very useful Free software to have on one’s computer.


If you want to receive future posts by email, enter your email address here:

Related Posts:

  • Convert DVD Movies to iPod Format(with Subtitles) Using Free Software
  • Step 3(c): Hardcoding Subtitles With MP4 Files Using XviD4PSP
  • Step 3(b): Merging Subtitles With MP4 Files Using Yamb/MP4Box
  • Step 4(a): Converting AVI Format to iPod Format Using Videora iPod Converter
  • Step 4(b): Converting AVI Format to N770/N800 Format Using Media Converter
  • Step 2(a): Converting DVD Format(VOB) to AVI(DivX/XviD) Format Using #1 DVD Ripper
  • Step 2(b): Converting DVD Format(VOB) to AVI(DivX/XviD) Format Using AutoGK

  • 44 Comments »

    1. [...] The existing MP4 files that are not compatible with iPod player can also be converted using Videora iPod Converter. If you want subtitles to be hardcoded in the video file before you transfer it to iPod using iTunes, then read how to merge subtitles with AVI files and do the Videora conversion after doing the subtitle merging process. [...]

      Quote

      Pingback by Every Flavour Beans » Step 4(a): Converting AVI Format to iPod Format Using Videora iPod Converter — May 29, 2007 @ 7:42 pm

    2. Thanks.
      It help me a lot…..

      Quote

      Comment by kw.wunna — August 16, 2007 @ 1:25 pm

    3. [...] Merging(Hardcoding) Subtitles With AVI(DivX/XviD) Files Using AviRecomp [...]

      Quote

      Pingback by XoDeus.dk Bloggen » Blog Archive » Hardcode undertekster på avi, den nemme — September 6, 2007 @ 3:52 am

    4. Hi,
      Its nice to merge with this tool AviRecomp but there’s one problem.
      I tried to merge subtitles to already compressed divx movie.
      As u said in step-3, I tried to give the output file size as same as
      the movie size, to merge it faster. But it took same damn 2 hours.

      Any suggestions for that???
      Plz reply, I m waiting.

      Quote

      Comment by amd007 — September 28, 2007 @ 6:49 am

    5. amd007 on September 28, 2007 at 6:49 am said:

      Hi,
      As u said in step-3, I tried to give the output file size as same as
      the movie size, to merge it faster. But it took same damn 2 hours.

      Burning subtitles into a video file taking 2 hours may not be surprising at all depending on the size of your DivX file and the configuration of your computer. On my Dual core 2.4 GHz machine, it took ~50 mins to burn subtitles to a 350MB/40min XviD video using 50%( i.e. one full core) of CPU. Do your math and see if it’s comparable to your merging times. Also see if the priority is not set too low (like “Idle”) in Settings -> Job Settings -> Process Priority. Try increasing it if that is the case.

      If you convert to DivX format yourself, then it might be a good idea to try merging the subtitles as part of the encoding process itself.

      Quote

      Comment by tabrez — September 28, 2007 @ 7:36 pm

    6. then why did u typed such line as
      “(if you don’t want to recompress/resize, specify the same size as that of the original file - this will be faster)”

      Quote

      Comment by amd007 — September 28, 2007 @ 7:57 pm

    7. amd007 on September 28, 2007 at 7:57 pm said:

      then why did u typed such line as
      “(if you don’t want to recompress/resize, specify the same size as that of the original file - this will be faster)”

      If you specify a smaller file size, then it would take *more* than 2 hours. Try it.

      Quote

      Comment by tabrez — September 28, 2007 @ 11:54 pm

    8. Thank u so much It’s the best topic on the net.

      Quote

      Comment by husainy — October 2, 2007 @ 1:29 am

    9. husainy:

      You are welcome! Maybe I should make a post on how to extract subtitles to independent srt/sub files from DVDs and how to join and split the subtitle files, few things that I frequently have to do :)

      Quote

      Comment by tabrez — October 4, 2007 @ 9:02 pm

    10. will this program work for archos 604 wifi? What should i do in order to merge subtitles into an avi file and then be able to broadcast it on my archos. Please help me!!

      Quote

      Comment by akis — November 2, 2007 @ 4:00 pm

    11. akis,
      I don’t own an Archos device, so can’t say for sure but Engadget(and other websites) says that Archos supports DivX/XviD video formats(through downloadable plugins) which means, yes, you can use AviRecomp. The output file you get will be in AVI/XviD format, so the file can be played on the Archos after you download a plugin for it from archos.com. In the worst case that you are not able to play XviD format on your Archos, you can convert the file into any other compatible format(mp4, H.264, wmv) using an appropriate conversion tool - the merged subtitles will still be there.

      Quote

      Comment by tabrez — November 3, 2007 @ 12:42 am

    12. thank you very much dear tabrez, i found the solution through your comments.

      Quote

      Comment by akis — November 5, 2007 @ 11:32 pm

    13. [...] Merging(Hardcoding) Subtitles With AVI Files Using AviRecomp [...]

      Quote

      Pingback by Step 4(b): Converting AVI Format to N770/N800 Format Using Media Converter — November 7, 2007 @ 6:22 pm

    14. i wish you could tell me where to download this tool…??
      please.?
      Avi Recomp

      Quote

      Comment by Jake — December 7, 2007 @ 9:06 pm

    15. ops…am sorry, i missed the link you posted. already noticed it.
      thanks!

      Quote

      Comment by Jake — December 7, 2007 @ 9:11 pm

    16. I’m a little late to the party, but I wanted to point out that my Archos 504 has native DivX/XVid support. H.264 and .mp4 files do require plugins, as do files with AAC or AC3 audio.

      Quote

      Comment by Zak — December 7, 2007 @ 9:25 pm

    17. i used it,but every time after it finish VirtualDub open again and begin from the beggining,it stop only when my hard disk storage in full.so it keep doing it automatically again and again,how i can make it stop when finish dubbing first time??

      Quote

      Comment by esso — December 8, 2007 @ 6:14 am

    18. after doing all the steps above how do I burn the file w/ hardcoded subtitles to DVD?

      Quote

      Comment by campodo12 — December 9, 2007 @ 10:33 pm

    19. Please let me know how to merge srt files to an mp4 file , so that i can watch it in my ipod

      Quote

      Comment by Ravi — January 1, 2008 @ 11:49 pm

    20. OK, I will figure that out and try to make a post on how to merge subtitles with mp4 files. What I currently do is:
      1. Merge subtitles with AVI/XviD file as described in this post
      2. Convert the merged file to iPod format using iPod Videora Converter or a similar tool.

      But of course if you have a video file already in iPod format, then just the merge step would be a faster way to do it.

      Quote

      Comment by tabrez — January 4, 2008 @ 11:05 pm

    21. hey,

      I was also trying to convert divx/xvid to mp4(iPod).

      I was trying Videora, which is free and does the trick in only 1 passage (from avi + srt to a mpeg4 with hardcoded subs). It seems to work ok, but the result for me was always a out of sync mp4 or h264. After reading a lot of forums about Videora I gave up.. its a really easy tool to use, but it has some serious well-known sync issues.

      After many unsuccessful tries with a lot of programs I found this post. Many thanks for the tip regarding AVI ReComp, works like a charm to merge the subtitles. Like stated before, the app does take some time to do the trick, took me around 25min to convert a 700mb divx avi into a 700mb divx avi with hardcoded subtitles. Good news is that everything is perfect, no sync problems.

      After that I’m using ImTOO iPhone video Converter to get it into a iPod compatible format, which is pretty fast compared to the avi -> avi phase.

      It kinda sux using 2 apps to be able to watch the stuff on my iPod, but at least the result is pretty good and perfectly sync’ed

      Quote

      Comment by Wayne — January 11, 2008 @ 9:32 am

    22. Yeah, it is tiresome that mere merging of subtitles with AVI files takes so much time. I see these options currently:
      1. If I have a DVD with subtitles in my language of choice, I include them when I encode them to XviD files. No separate step needed.
      2. If I have an MP4 file, then I have found that MP4Box merges the subtitles in real quick time:
      Step 3(b): Merging(Hardcoding) Subtitles With MP4 Files Using Yamb/MP4Box
      3. If I have an AVI/XViD file, then I try really hard to find media players that can read and display subtitles while playing the video files. It’s not an issue on computers but handhelds usually do not come with such ’sophisticated’ media players. Reportedly, MPlayer on Nokia tablets(N800) and next version of Creative Zen Vision players support external subtitles.
      4. I use AviRecomp to merge subtitles with AVI files only for whatever is left from Point 3.

      You can try using Videora to only convert DivX/XviD to MP4 and then merge subtitles using Yamb.

      Quote

      Comment by tabrez — January 11, 2008 @ 11:59 pm

    23. thanks….

      Quote

      Comment by fwtos — January 15, 2008 @ 12:48 pm

    24. This tutorial helped, but my MPEG4 codec is listed as DV and when I compress from 800mb down to 99mb for uploading to youtube I lose my audio. The Audio area in the ‘Data’ section tells me I have no audio stream yet when I resize down to 320 x 256 and preview I have audio. It’s obviously embedded in it but then it disappears.

      Any know how to work around this please?

      Quote

      Comment by Snapper — January 16, 2008 @ 5:49 am

    25. Can you use this program to merge srt with mpg files? I have a VCD that I want to hardcode subtitles to.

      Quote

      Comment by Ray — January 18, 2008 @ 4:29 am

    26. Dear friend,
      I am trying to merge subtitles into an avi film. When I preview it everything is all right but when I give it the go to recompress, it only records 7 seconds and indicates the job is successfully done !!!
      I have tried changing the name of the film, moving it to another folder, but nothing works.
      Please, HEEEELP!

      Quote

      Comment by Mario — February 16, 2008 @ 7:26 pm

    27. what is the script avs thing?its the one that takes a long time?

      Quote

      Comment by Anonymous — March 9, 2008 @ 4:42 am

    28. when i try to load a subtitle it says

      This file has invalid format!

      how can i make it so it can read the subtitle?!??!?!

      Quote

      Comment by Massacher — March 20, 2008 @ 6:48 pm

    29. XoDeus.dk Bloggen » Blog Archive » Hardcode undertekster på avi, den nemme on September 6, 2007 at 3:52 am said:

      [...] Merging(Hardcoding) Subtitles With AVI(DivX/XviD) Files Using AviRecomp [...]

      Ok i attempted what you have shown above.

      1. I added in the avi file and specified the new file name
      2. Added the srt (subtitle) file with the way you mentioned above.
      3. I have clicked the “add to queue” button,

      Heres where it goes wrong. I see the movie under the job list (status shows “waiting”) - not sure if thats what is meant to say. I then click start (status reads “running”), after the process completes and reads 100% (status reads “failed”)

      Now the folder that is created with the new movie has 6 files in it.
      1. Avi file
      2. audio file
      and the rest are just some random small files.

      Why does this happen. Subtitles arent merged, and a seperate audio and video file are created.

      Quote

      Comment by emilio — April 20, 2008 @ 7:00 pm

    30. I have added the output file of the process. I believe i might just need to install the Virtualdub Plugin.

      **20/04/2008 11:28:16 PM** Running first pass…

      **20/04/2008 11:28:17 PM** First pass failed :( .

      **20/04/2008 11:28:17 PM** First pass duration was: 0 hr 0 min. 1 sec.

      **20/04/2008 11:28:17 PM** EXCEPTION: Error during the first pass!

      **20/04/2008 11:28:17 PM** Avisynth open failure:
      LoadVirtualdubPlugin: Error opening “C:\Program Files\AVI ReComp\Filters\textsub.vdf”
      (D:\Other\Movies\Counterfeiters.avi_AVI ReComp_temp\script.avs, line 1)

      **20/04/2008 11:28:17 PM** Total working time: 0 hr 2 min. 44 sec.

      Quote

      Comment by emilio — April 20, 2008 @ 7:03 pm

    31. emilio on April 20, 2008 at 7:03 pm said:

      I have added the output file of the process. I believe i might just need to install the Virtualdub Plugin.

      **20/04/2008 11:28:16 PM** Running first pass…

      **20/04/2008 11:28:17 PM** First pass failed :( .

      **20/04/2008 11:28:17 PM** First pass duration was: 0 hr 0 min. 1 sec.

      **20/04/2008 11:28:17 PM** EXCEPTION: Error during the first pass!

      **20/04/2008 11:28:17 PM** Avisynth open failure:
      LoadVirtualdubPlugin: Error opening “C:\Program Files\AVI ReComp\Filters\textsub.vdf”
      (D:\Other\Movies\Counterfeiters.avi_AVI ReComp_temp\script.avs, line 1)

      **20/04/2008 11:28:17 PM** Total working time: 0 hr 2 min. 44 sec.

      Quote

      Comment by dougly — April 25, 2008 @ 7:30 am

    32. What about syncronisation?
      So far I always had to watch films+subtitles on my computer (with Vlc) because this way I could adjust voice and subtitles.
      If I hardcode avi+subtitles, how can I check before merging they will be fine?

      Quote

      Comment by miroure — May 2, 2008 @ 3:29 am

    33. in other words:
      when avi and subtitles are separate files, I can use VLC (using sync)
      But if I merge the 2 files with AVI Recomp then it is impossible to adjust, moreover it means that if I want to burn it to a cd for watching it in a Dvd player in the living room (not a PC) there’s no way no adjust sync. Any idea in before merging how to adjust sync?

      Quote

      Comment by miroure — May 2, 2008 @ 11:44 am

    34. mioure,
      Using AVI ReComp, you can check the audio is in sync by clicking Preview in the Queue tab.

      Quote

      Comment by Will — May 2, 2008 @ 11:23 pm

    35. thanks for the help ! appreciate it =)

      Quote

      Comment by Felix — May 16, 2008 @ 7:59 pm

    36. miroure,
      you first need to synchronise the subtitle file with the video, which involves finding out the framerate of the video file and the framerate for which the subtitle file was created, subtitle start offset(positive or negative). You can do such editing using the Subtitle Workshop software. Search the online forums for tutorials on how to do that. E.g. Doom9.org.

      Quote

      Comment by tabrez — May 16, 2008 @ 8:06 pm

    37. This tutorial is brilliant. I mananged to do it all by myself. Keep up the good work.

      Quote

      Comment by etta — May 18, 2008 @ 12:11 am

    38. Thank you very much dude!!!
      i just googled ‘tool to merge subtitles’ and i found your post.. thanks to google too!!

      Quote

      Comment by bragadeesh — May 18, 2008 @ 12:55 pm

    39. does doing this will not lose any quality of the video??? its just combining the subtitle and d video???

      Quote

      Comment by dvdaddict — June 5, 2008 @ 12:53 am

    40. dvdaddict, Merging subtitles with the video doesn’t affect the quality of the video.

      Quote

      Comment by tabrez — June 5, 2008 @ 10:00 am

    41. thank you amigo.I learned completly anything i wanted to know about merging subtitles and …
      god bless you. good Luck

      Quote

      Comment by Alireza — June 10, 2008 @ 12:59 pm

    42. Thanks for this information. actualy i got tired of searching net to find softeware for merging subtitle with avi movies.Ill try this one and hope it works

      Quote

      Comment by alam — June 30, 2008 @ 12:02 pm

    43. Nice tutorial for merging video and subtitle! Good work, bro! Keep up this!

      Quote

      Comment by Samson Delila — July 19, 2008 @ 3:17 pm

    44. I spent the better part of 2 days using I don’t know how many different dl’s to hardcode an .srt file into an .avi file. This worked perfectly. Thanks very much for the information!

      Quote

      Comment by jp — July 30, 2008 @ 2:15 am

    RSS feed for comments on this post. TrackBack URI

    Leave a comment

    Subscribe without commenting


    Copyright (c) 2006, 2007 Tabrez Iqbal.
    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


    Powered by WordPress
    This website is hosted by Dreamhost