I'm struggling with a specific use case which's aspects have been addressed online but not combined (to my knowledge). I hope I came to the right place.
I often have a m2ts/mkv blu ray rip with multiple audio, subtitle and (for some weird reason*) video files. My LG TV does not play TrueHD and my fathers not even DTS, so I always need to create an additional AC3 file if there is none present yet.
TASKS I need to do:
- strip away the unnecessary files
- convert DTS audio files to AC3 (5.1 + 640k) while maintaining the DTS file
Example (bold = keep, italics = remove)
- Track 0: Video 0
- Track 1: Video 1 (only green screen ??)
- Track 2: Audio 0 True HD English
- Track 3: Audio 1 AC 3 5.1 English
- Track 4: Audio 2 DTS 7.1 French
- Track 5: Audio 3 DTS 7.1 German
- **Track 10: Subtitle 0 SRT English
- ** Track 11: Subtitle 1 SRT French
- Track 12: Subtitle 2 SRT German
With my limited ffmep-knowledge I know how to copy, convert or delete specific streams but not how to do all that in one process while maintaining the DTS track. For 4k files of up to 100 GB from an external hard drive this can be really annoying and take a long time.
My idea was to do that with following 3 steps in one command line:
ffmpeg -i input.mkv
-map 0:v:0 -map 0:a:0 -map 0:a:1 -map 0:a:3 -map 0:s:0 -map 0:s:2 --> select the streams I want to keep
-c:v copy -c:a copy -c:s copy --> copy all (previous selected) streams
-c:a:3 ac3 -b:a:4 640k --> convert only the specific DTS "audio stream 3" (German) to AC3 5.1 with 640k
Question1: What did I miss?
Question 2: Do I really get AC3 5.1 with 640k? Online I read that if I use 640k it will automatically do 5.1 and then I read that the converstion needs to look as follows: -acodec ac3 -ac 6 -ab 640k 2a) do I need the -acodec? 2b) do I need the -ac 6?
*Question 3: Why is there always a 2nd video file that only contains a green screen? I always delete it and it seems to be fine but I'm just wondering what that is. Couldn't find any info online.
Thank you very much, I really hope someone can help me here. I really would like to understand the code and find a solution which I can apply not only for this but for diverging use cases in the future.