Reputation: 1145
I'm looking for a way to re-encode the video stream of a movie only and keep all other streams as they are using ffmpeg
or more specific streamio/streamio-ffmpeg
(Github - StreamIO-FFMPEG).
I already tried various combinations of -map 0
or -map a:0 -map s:0
, but in all combinations I tried, either nothing is encoded at all, or not all other streams are copied to the new file. In most cases there is only one audio stream after encoding, when there were two before, and sometimes the subtitle streams are lost, too. Also most times the info what language the streams are in gets lost.
So when I have a movie file (mkv) with the following streams:
0: video [H.264, 1080p]
1: audio [english, mp3]
2: audio [french, mp3]
3: subtitle [english (forced)]
4: subtitle [english]
What should the ffmpeg
parameters be, if I want to encode the video file to H.265
and 720p
and keep all other streams as they are?
What should the parameters be, if I additionally want to encode the audio streams as AAC
?
Thanks in advance!
Upvotes: 0
Views: 11632
Reputation: 93329
Use
ffmpeg -i in.mkv -vf scale=hd720 -map 0 -c copy -c:v libx265 out.mkv
To encode audio as well,
ffmpeg -i in.mkv -vf scale=hd720 -map 0 -c copy -c:v libx265 -c:a aac out.mkv
(The order of the arguments above matter)
Upvotes: 6