Hello everyone.
FFmpeg does not copy subtitles with two input files.
To convert my videos to Av1and Opus, I first use the following command to convert the video track to Av1 :
Then I use the following command to add the Av1 video track, convert the audio track from the start file to Opus and copy the subtitle track from the start file:Code:ffmpeg -i video.5.1.subfr.mkv -map 0:v:0 -pix_fmt yuv420p10le -f yuv4mpegpipe -strict -1 - | SvtAv1EncApp -i stdin --preset 6 --keyint 240 --input-depth 10 --crf 30 --rc 0 --passes 1 --film-grain 0 -b av1.ivf
Once done, I look at the video.5.1.av1.opus.subfr.mkv file with MKVToolNix Gui, there is no subtitle track.Code:ffmpeg -i av1.ivf -i video.5.1.subfr.mkv -map 0:v -map 1:a:0 -c:v copy -c:a libopus -af channelmap=channel_layout=5.1 -b:a 250k -vbr on -c:s copy video.5.1.av1.opus.mkv
After thinking about it, I wonder if I shouldn't map the subtitle track with :
-map 1:s
Or :
-map 1:s:0
positioned after :
-map 0:v -map 1:a:0
I looked at the documentation of FFmpeg on the official website but it is not clear to me at all.
I'm already converting a video track to Av1, which takes several hours so I'm asking before I'm done. If I don't get an answer by then, I'll do some tests and report the results here.
If anyone has any ideas?
Thanks
Ignace.
+ Reply to Thread
Results 1 to 7 of 7
-
Last edited by ignace72; 30th Mar 2022 at 21:10.
-
Hello, October262.
Thank you for your quick and precise answer.
According to the link I gave myself, adapted to my case, I had to add :
Code:-map 1:s?
This will allow me to be sure that the subtitles are well copied.
Positioned after :
Code:-map 0:v -map 1:a:0
Thanks again.
Ignace. -
Hello.
Sorry, but since last night the conversion process has been stuck at 26 minutes without returning to the command prompt and therefore without an error message.
I didn't realize it until 30 minutes ago.
So I just restarted the process.
So I'll get back to you to report on the modified command test as mentioned above after the process is complete.
Thank you.
Ignace. -
That's it, the conversion of the video track to Av1 is finished.
Adding -map 1:s? to my command works perfectly.
Problem solved.
Thanks, october262.
Ignace.Last edited by ignace72; 1st Apr 2022 at 03:13.
-
Anonymous543Guest
Try -c:s copy command
-c:s = command for selecting codec of subtitle
copy = copies subtitle stream without rencode -
Hello, kirito.
You didn't read my first and last messages.
The piece of order you suggest is already present in my order and I indicated the piece of order that was missing, and I indicated that my problem is solved.
Ignace.
Similar Threads
-
ffmpeg -force_key_frames chapters with Multiple Input Files
By koberulz in forum Newbie / General discussionsReplies: 1Last Post: 29th Aug 2021, 11:02 -
thorny problem: adding subtitles to vob files in standard US DVD copy
By idatarbell in forum SubtitleReplies: 2Last Post: 23rd Dec 2020, 23:53 -
How to I nstall the FFMPEG input driver in VirtualDub?
By Avagadro1 in forum Newbie / General discussionsReplies: 3Last Post: 13th Aug 2020, 01:26 -
[solved] ffmpeg -i -vn -c:a copy (clean file) on multiple files - fails
By Prototype v1.0 in forum LinuxReplies: 21Last Post: 11th Aug 2019, 04:43 -
FFMPEG or FFMBC on xdcamhd422 files: how to copy audio track4 into track2?
By marcorocchini in forum Newbie / General discussionsReplies: 11Last Post: 11th Aug 2017, 16:25