occivink / mpv-scripts

Various scripts for mpv
The Unlicense
420 stars 38 forks source link

-map parameters seem to be wrong #22

Closed sammoth closed 6 years ago

sammoth commented 6 years ago

Hi,

I tried encoding part of a video which had subtitles (enabled in mpv) and an audio stream (disabled in mpv)

The script generated this command:

ffmpeg -ss 08:52.098 -i "./Knowing.Bros.E120.180324.1080p-NEXT.mkv" -to 3.3866823334108 -map 0:0 -map 0:2 -filter:v "crop=892:1064:14:14" -c:v libx264 -c:a aac -b:a 128k -preset slow -crf 19 "<...>/Knowing.Bros.E120.180324.1080p-NEXT_1.mp4"

which fails with this output:

Automatic encoder selection failed for output stream #0:1. Default encoder for format mp4 (codec none) is probably disabled. Please choose an encoder manually.
Error selecting an encoder for stream 0:1

If I change the -map 0:2 parameter to -map 0:1, it works

occivink commented 6 years ago

Can you paste the output of ffmpeg -i "./Knowing.Bros.E120.180324.1080p-NEXT.mkv"? It's hard to answer without knowing the channels of the file.

sammoth commented 6 years ago

Sorry I was completely misinterpreting what the problem was. This was just caused because I changed the ffmpeg parameters from the default to remove -sn and hadn't specified a subtitle codec with -scodec. ffmpeg tries to copy the subtitle stream by default but in this case the format was not compatible with the mp4 container.