Anime4000 / IFME

Powerful x265 GUI Encoder
https://x265.github.io/
GNU General Public License v2.0
239 stars 53 forks source link

Unable to add text subtitles to mp4 format #228

Open longwu9t opened 1 week ago

longwu9t commented 1 week ago

When making mp4 from mkv with subtitles, or manually adding text subtitles, I hope it can be done normally, instead of being impossible as it is now, similar to the function provided by ffmepg: ... -map 0:s:0 -c:s mov_text ... Thanks!!!

Anime4000 commented 1 week ago

Here I made quick fix, see this works for you IFME_try8.3.zip

longwu9t commented 1 week ago

thanks you!!! version 8.3 can't complete the work either.

The following is the log:

Internet Friendly Media Encoder 8.3 ( '天空の旅, Tenkuu no Tabi - Journey of the Sky' ) Build: IFME v8.3 windows amd64 znver2 (Zen 2 architecture)

(c) 2024 Anime4000, MulticoreWare, VideoLAN, IETF, Xiph.Org Foundation, Josh Coalson, Erik de Castro Lopo, Jean Le Feuvre, People@GPAC, FFmpeg Team, Nero AG, Moritz Bunkus, AMD, Intel, Nvidia, Google, Alliance for Open Media, et al.

Contributor: Nemu, Jel42, Robin Lawrie, Ron Mitschke, Project Angel

Warning, DO NOT close this Terminal/Console, all useful info will be shown here.

[INFO] No error during plugins initialising... [INFO] Extracting subtitle file... [DEBG] Command Line: "C:\proApp\IFME\Plugins\ffmpeg64\ffmpeg" -hide_banner -v error -stats -i "D:\vdo\cat.mkv" -map 0:2 -map_metadata -1 -map_chapters -1 -vn -an -dn -scodec copy -y subtitle0000_0000_und.ass [INFO] Extracting embeded attachment... [DEBG] Command Line: "C:\proApp\IFME\Plugins\ffmpeg64\ffmpeg" -hide_banner -v error -stats -i "D:\vdo\cat.mkv" -f ffmetadata metadata.ini -y [INFO] Encoding audio file... [INFO] Fast Remuxing Audio... [DEBG] Command Line: "C:\proApp\IFME\Plugins\ffmpeg64\ffmpeg" -hide_banner -v error -i "D:\vdo\cat.mkv" -map 0:1 -c:a copy -y audio0000_und.mov [INFO] Fast Remuxing Video... [DEBG] Command Line: "C:\proApp\IFME\Plugins\ffmpeg64\ffmpeg" -hide_banner -v error -i "D:\vdo\cat.mkv" -map 0:0 -c:v copy -y video0000_und.mov [ OK ] Fast Remux is complete... Exit Code 0 [INFO] Multiplexing encoded files into single file... [DEBG] Command Line: "C:\proApp\IFME\Plugins\ffmpeg64\ffmpeg" -strict -2 -hide_banner -v error -stats -i "video0000_und.mov" -i "audio0000_und.mov" -i "subtitle0000_0000_und.ass" -f ffmetadata -i metadata.ini -map 0:0 -map 1:0 -map 2:0 -c copy -metadata:g "encoding_tool=IFME 8.3 windows amd64" -metadata:s:0 title="Undetermined" -metadata:s:0 language=und -metadata:s:1 title="Undetermined" -metadata:s:1 language=und -metadata:s:2 title="Undetermined" -metadata:s:2 language=und -disposition:s:0 default -y "Z:\cat.mp4" [mp4 @ 000002caa29aff80] Could not find tag for codec ass in stream #2, codec not currently supported in container [out#0/mp4 @ 000002caa06d7c00] Could not write header (incorrect codec parameters ?): Invalid argument [ERR ] FFmpeg failed to merge raw files... Check [Muxing Failed] folder to manual muxing... [ERR ] FFmpeg return code -22

At the end the following files were left: z:[Muxing Failed]\cat.mp4\audio0000_und.mov z:[Muxing Failed]\cat.mp4\metadata.ini z:[Muxing Failed]\cat.mp4\subtitle0000_0000_und.ass z:[Muxing Failed]\cat.mp4\video0000_und.mov

longwu9t commented 1 week ago

ffmpeg -i cat.mkv -map 0:v:0 -c:v copy -map 0:a:0 -c:a copy -map 0:s:0 -c:s mov_text -map_chapters -1 cat.mp4

Using the above command, ffmpeg works just fine.

Anime4000 commented 1 week ago

The error:

[mp4 @ 000002caa29aff80] Could not find tag for codec ass in stream #2, codec not currently supported in container

I guess for mp4, always convert subtitle to -c:s mov_text codec

Test import Raw BDRip and steal subtitle from [SubsPlease]: Screenshot 2024-06-19 141058 Screenshot 2024-06-19 140055

Test play: Screenshot 2024-06-19 135510

Try this: IFME_try8.3.1.zip

longwu9t commented 1 week ago

this time it works thanks!!!

Anime4000 commented 1 week ago

Nice, it's time to release next version