VideoHelp Forum
+ Reply to Thread
Results 1 to 7 of 7
Thread
  1. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    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 :
    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
    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 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
    Once done, I look at the video.5.1.av1.opus.subfr.mkv file with MKVToolNix Gui, there is no subtitle track.

    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.
    Last edited by ignace72; 30th Mar 2022 at 21:10.
    Quote Quote  
  2. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by ignace72 View Post
    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 :
    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
    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 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
    Once done, I look at the video.5.1.av1.opus.subfr.mkv file with MKVToolNix Gui, there is no subtitle track.

    After thinking about it, I wonder if I shouldn't map the subtitle track with :
    -map 1
    Or :
    -map 1: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.
    try this here - https://superuser.com/questions/1273764/using-ffmpeg-on-how-do-i-copy-the-video-and-mu...eams-in-an-mkv
    Quote Quote  
  3. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    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?
    -map 1 to indicate to use the second input file :s to indicate to take care of the subtitles and ? to take all the available subtitles.
    This will allow me to be sure that the subtitles are well copied.
    Positioned after :
    Code:
    -map 0:v -map 1:a:0
    I don't know if I've got it right, I'll test it once my current conversion is finished, I'll come back afterwards to say if it's good or not.
    Thanks again.
    Ignace.
    Quote Quote  
  4. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    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.
    Quote Quote  
  5. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    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.
    Quote Quote  
  6. Anonymous543
    Guest
    Try -c:s copy command

    -c:s = command for selecting codec of subtitle
    copy = copies subtitle stream without rencode
    Quote Quote  
  7. Member
    Join Date
    Mar 2022
    Location
    Les Sables D'Olonne, France
    Search Comp PM
    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.
    Quote Quote  



Similar Threads

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