FFmpeg seems to be unable to transmux when remapping streams
You haven't set subtitle codec mode so ffmpeg will try to automatically select a subtitle encoder. However, the MP4 muxer hasn't registered a default subtitle encoder, so the command fails.
Use
ffmpeg -progress pipe:1 -hide_banner -i /path/to/file.mkv -map 0:v -map 0:a -map 0:s -c:a aac -c:v copy -c:s mov_text /path/to/outfile.mp4
Note that SRT is not officially supported in MP4s, so you have to re-encode it.
Related videos on Youtube
Fr3ddyDev
Updated on September 18, 2022Comments
-
Fr3ddyDev almost 2 years
I'm trying to reorder a video's streams in the form of video streams first, audio streams and then subtitles. I thought I could also change the format of the video from
mkv
to more common one likemp4
but no matter what I try it still shows this error message:Input #0, matroska,webm, from '/path/to/file.mkv': Metadata: encoder : libebml v1.3.6 + libmatroska v1.4.9 creation_time : 2019-06-17T20:41:37.000000Z Duration: 01:03:10.17, start: 0.000000, bitrate: 1215 kb/s Chapter #0:0: start 0.054000, end 3790.174000 Metadata: title : Capitolo 01 Stream #0:0(ita): Subtitle: subrip (default) Metadata: BPS-eng : 4 DURATION-eng : 00:52:26.144000000 NUMBER_OF_FRAMES-eng: 37 NUMBER_OF_BYTES-eng: 1627 _STATISTICS_WRITING_APP-eng: mkvmerge v30.1.0 ('Forever And More') 64-bit _STATISTICS_WRITING_DATE_UTC-eng: 2019-06-17 20:41:37 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:1(ita): Audio: aac (LC), 48000 Hz, stereo, fltp (default) Metadata: BPS-eng : 113000 DURATION-eng : 01:03:10.165000000 NUMBER_OF_FRAMES-eng: 177664 NUMBER_OF_BYTES-eng: 53536337 _STATISTICS_WRITING_APP-eng: mkvmerge v30.1.0 ('Forever And More') 64-bit _STATISTICS_WRITING_DATE_UTC-eng: 2019-06-17 20:41:37 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:2: Video: h264 (High), yuv420p(progressive), 720x404 [SAR 1:1 DAR 180:101], 25 fps, 25 tbr, 1k tbn, 50 tbc (default) Metadata: BPS-eng : 1100698 DURATION-eng : 01:03:10.080000000 NUMBER_OF_FRAMES-eng: 94752 NUMBER_OF_BYTES-eng: 521466768 _STATISTICS_WRITING_APP-eng: mkvmerge v30.1.0 ('Forever And More') 64-bit _STATISTICS_WRITING_DATE_UTC-eng: 2019-06-17 20:41:37 _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Automatic encoder selection failed for output stream #0:2. Default encoder for format mp4 (codec none) is probably disabled. Please choose an encoder manually. Error selecting an encoder for stream 0:2
This is my current command:
ffmpeg -progress pipe:1 -hide_banner -i /path/to/file.mkv -map 0:2 -map 0:1 -map 0:0 -c:a aac -c:v copy /path/to/outfile.mp4
Does anyone know how to do this using only one pass with FFmpeg?