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.
+ Reply to Thread
Results 1 to 18 of 18
-
-
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.
-
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
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.
-
Update here: I just stopped the process abruptly and the subtitles are not showing up. Any other thoughts?
-
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
-
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?
-
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. -
I believe the log file is here. Please let me know if you have it.
-
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)
-
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.
-
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.
-
-
Still no subtitles.
Very frustrated. I did what you said. Here are some screen shots of an error and the folder path.
-
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.
-
That was it. I actually caught that mistake a couple hours ago. Thanks for your patience and help.
Similar Threads
-
remux mp4 question: PLEASE HELP
By maverickluke in forum Video ConversionReplies: 62Last Post: 23rd Jun 2017, 09:36 -
Remux Mp4
By danielmak in forum MacReplies: 1Last Post: 11th Sep 2014, 02:17 -
Adding subtitle(.srt) to mp4 without re-encoding ( For Web player )
By farukest in forum SubtitleReplies: 4Last Post: 22nd Apr 2014, 03:01 -
Any good software for adding permanent subtitle to a mp4 video?
By netcat in forum SubtitleReplies: 2Last Post: 26th Nov 2013, 17:22 -
Adding subtitle (.srt) to MKV, AVI and MP4 files
By taebog in forum SubtitleReplies: 3Last Post: 2nd Nov 2012, 11:26