VideoHelp Forum




+ Reply to Thread
Results 1 to 18 of 18
  1. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I currently have an mkv file which as an SSA file that I embedded. I want to burn this in to an mp4 from this mkv file. I am currently copying my video and audio file and creating an aac file. I am telling you this information because the current command in the bat file looks like this:

    @echo off
    rem drop MP4 file onto this batch
    rem it will use video and audio, mapped as 0:0 and 0:1 creating third audio track

    set "ffmpeg=D:\Documents\Other Programs\MP4 Demux & Remux\ffmpeg.exe"

    if "%~n1"=="" echo you need to drop videofile onto this batch script& pause&goto :eof
    "%ffmpeg%" -i "%~1" -map 0:0 -map 0:1 -map 0:1 -map_metadata -1 -map_chapters -1 -c:v copy -c:a:0 copy -c:a:1 aac -b:a:1 160k -ac:a:1 2 -strict -2 "new_%~n1.mp4"
    pause
    goto :eof

    Please advise me on what I need to add and do so I can get the SSA file in the mp4. Thanks for your help in advance.
    Quote Quote  
  2. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Can someone please help and answer my question?? As a little more history, I started with an .mp4 file that I want to add (burn in the subtitle) to. I also am starting with an .srt which I used subtitle edit to convert to an ssa. I then used MKV Toolnix to add the ssa to the file which converted it to an mkv. Now I am wanting to burn in the subtitle to the video file and have an mp4 again. My end result which I am looking for is how to have my mp4 with a burned in subtitle. Thanks.
    Quote Quote  
  3. Try:
    Code:
    @ECHO OFF
    SET ffmpeg="D:\Documents\Other Programs\MP4 Demux & Remux\ffmpeg.exe"
    
    PUSHD %~dp0
    
    :loop
    if [%1]==[] goto :end
    %ffmpeg% -i "%~1" -map 0:v:0 -map 0:a:0 -map 0:a:0 -map_metadata -1 -map_chapters -1 -c:v libx264 -preset medium -crf 20 -level 40 -maxrate 20M -bufsize 20M -vf "subtitles=%~nx1" -c:a:0 copy -c:a:1 aac -b:a:1 160k -ac:a:1 2 -sn "new_%~n1.mp4"
    SHIFT
    goto loop
    
    :end
    pause
    ===================================


    Originally Posted by maverickluke View Post
    I then used MKV Toolnix to add the ssa to the file which converted it to an mkv.
    You can skip this step if you give subtitle and video file identical names and put them into the same folder, e.g. "movie.mp4" and "movie.ass" (or "movie.srt"). Then:
    Code:
    @ECHO OFF
    SET ffmpeg="D:\Documents\Other Programs\MP4 Demux & Remux\ffmpeg.exe"
    
    PUSHD %~dp0
    
    :loop
    if [%1]==[] goto :end
    %ffmpeg% -i "%~1" -map 0:v:0 -map 0:a:0 -map 0:a:0 -map_metadata -1 -map_chapters -1 -c:v libx264 -preset medium -crf 20 -level 40 -maxrate 20M -bufsize 20M -vf "subtitles=%~n1.ass" -c:a:0 copy -c:a:1 aac -b:a:1 160k -ac:a:1 2 -sn "new_%~n1.mp4"
    SHIFT
    goto loop
    
    :end
    pause
    Last edited by sneaker; 16th May 2017 at 13:47.
    Quote Quote  
  4. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Update here: I just stopped the process abruptly and the subtitles are not showing up. Any other thoughts?
    Quote Quote  
  5. This is the same as the first code but will also create a log file. Upload the log file.

    Code:
    @ECHO OFF
    SET ffmpeg="D:\Documents\Other Programs\MP4 Demux & Remux\ffmpeg.exe"
    
    PUSHD %~dp0
    
    :loop
    if [%1]==[] goto :end
    %ffmpeg% -report -i "%~1" -map 0:v:0 -map 0:a:0 -map 0:a:0 -map_metadata -1 -map_chapters -1 -c:v libx264 -preset medium -crf 20 -level 40 -maxrate 20M -bufsize 20M -vf "subtitles=%~nx1" -c:a:0 copy -c:a:1 aac -b:a:1 160k -ac:a:1 2 -sn "new_%~n1.mp4"
    SHIFT
    goto loop
    
    :end
    pause
    Quote Quote  
  6. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Where do I find the log file?
    Quote Quote  
  7. In the same folder as the video as "ffmpeg-[...].log".
    Quote Quote  
  8. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    The log file is over 57MB. I tried uploading it 3 times and even copied and pasted the text but probably too big. Bottom line is the new mp4 has no subtitles in it. What now?
    Quote Quote  
  9. 7zip/rar/zip the log. (That said, videohelp forum says it supports 500 MB .log files as attachments. Don't try as copy&paste.)

    My hunch is you are missing a valid font config. But I'd rather have the log instead of guessing.
    Quote Quote  
  10. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I believe the log file is here. Please let me know if you have it.
    Image Attached Files
    Quote Quote  
  11. Yes, I have it. See the instructions about font config I linked in my last post. (or add font file as attachment but getting the font config right is always good for fallback)
    Quote Quote  
  12. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    OK. If I unzip and put the fonts.conf in the same folder as ffmpeg.exe and the bat file it should work, right? I just did that and when I dropped the mkv file on the bat file I got the same error messages in the beginning and it is processing now as you receive this message. Thoughts? I'll let the file process into the mp4 and hope it works this time.
    Quote Quote  
  13. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Update: The new mp4 has no subtitles once again. Refer to my last post in terms of what I did with the fonts file. Here is the latest log file.
    Image Attached Files
    Quote Quote  
  14. Originally Posted by maverickluke View Post
    OK. If I unzip and put the fonts.conf in the same folder as ffmpeg.exe and the bat file it should work, right?
    No. Please read everything I wrote in the other thread carefully.

    wrong:
    \ffmpeg.exe
    \fonts.conf

    correct:
    \ffmpeg.exe
    \fonts\fonts.conf
    Quote Quote  
  15. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    Still no subtitles. Very frustrated. I did what you said. Here are some screen shots of an error and the folder path.
    Image Attached Thumbnails Click image for larger version

Name:	Error.PNG
Views:	223
Size:	53.1 KB
ID:	41655  

    Click image for larger version

Name:	Folders.PNG
Views:	265
Size:	56.6 KB
ID:	41656  

    Click image for larger version

Name:	Error 2.PNG
Views:	444
Size:	56.5 KB
ID:	41657  

    Quote Quote  
  16. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    I read the previous post several times over and I am having the same problem as the other person getting the message "no usable fontconfig configuration file found" The thing that seemed to work for him was copying the binary file from bin to ffmpeg installation folder. I don't understand what the binary file is. Please advise.
    Quote Quote  
  17. In your screenshots you have "c:\video processing\...." but in the scripts I posted it is "d:\documents\...". Do you have maybe the scripts still pointed to "d:\documents\..." with an ffmpeg.exe but without the "fonts\fonts.conf"?
    Quote Quote  
  18. Member
    Join Date
    Sep 2006
    Location
    United States
    Search Comp PM
    That was it. I actually caught that mistake a couple hours ago. Thanks for your patience and help.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!