1

I'm using Debian 9. I have a file with several audio tracks and subtitles in PGS. I'd like to pass the video to h265 and keep all the audio tracks and subtitles as they are to an .mkv container, since as I understand it mp4 does not support image-based subtitles.

The command that I use is:

ffmpeg -i entrada.264.mkv -c:v libx265 -f matroska -map 0 salida.265.mkv

but I get this error in ffmpeg:

[matroska,webm @ 0x55ec1759fee0] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x55ec1759fee0] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x55ec1759fee0] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x55ec1759fee0] Could not find codec parameters for stream 9 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x55ec1759fee0] Could not find codec parameters for stream 10 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x55ec1759fee0] Could not find codec parameters for stream 11 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Only SUBTITLE_ASS type supported.
Subtitle encoding failed

And, wanting to copy them one at a time, simply burn the first one.

Here is the data of the file in question:

In summary:

Expected result: Recode a video file to h265 and copy all the audio and subtitles without modifying them or burn them in the video to be able to choose which one to use.

Result obtained: Error due to lack of parameters for the subtitles.

Is there a way to do it directly from ffmpeg without having to extract the subtitles one by one, and then add them to the video through some program like mkvmerge?

  • 1
    Get a recent ffmpeg from here and try this: ffmpeg -i entrada.264.mkv -map 0 -c copy -c:v libx265 salida.265.mkv – llogan Mar 28 '19 at 17:39
  • 1
    Thank you very much and sorry for the delay in responding (I have problems with my internet provider. That command works perfectly. I do not know how to mark the answer as correct, but this is it. Thanks again. – jota jota Lopez Mar 30 '19 at 12:32
1

Stream copy (re-mux) everything but the video:

ffmpeg -i entrada.264.mkv -map 0 -c copy -c:v libx265 salida.265.mkv

-map 0 includes all streams from the input to the output instead of relying on the default stream selection behavior which only includes one stream per stream type.

| improve this answer | |
0

This is not an error. It's a warning message. The -loglevel warning returns the message:

ffmpeg -i entrada.264.mkv -loglevel warning -c:v libx265 -f matroska -map 0 salida.265.mkv

And the -loglevel error suppresses it:

ffmpeg -i entrada.264.mkv -loglevel error -c:v libx265 -f matroska -map 0 salida.265.mkv

I tested all subtitles of my own output mkv file through Subtitle Edit and they are all intact. I think this warning is displayed to warn you only, if you decide to re-encode these subtitles later.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.