[FFmpeg-user] Requesting expert assistance with ffmpeg-user command dropping original track/codec

Joel Samson joel.samson at hotmail.com
Mon Jan 3 03:49:20 EET 2022

Hello everyone,

I am new and noticed ffmpeg didn't have an official forum, I am sorry if I am following this incorrectly as I did try to read the documentation found here:
Please let me know and redirect me if I am asking my question at the wrong place.

In short; I asked the question here on SuperUser forums and I am pending a response: windows - ffmpeg : Not keeping original codec for Audio Track - Super User<https://superuser.com/questions/1697037/ffmpeg-not-keeping-original-codec-for-audio-track>

I currently am using this command:

ffmpeg -i "File" -map 0:v:0 -map 0:a:m:language:eng -c copy -f matroska - | ffmpeg -i - -map 0:v -map 0:a:0 -c copy -c:a eac3 -metadata:s:a:0 title="EAC3 Transcoded" -b:a:0 640k "File"
This version of the command seems to do the following (correctly) which I want:

  1.  Transcodes the primary audio track whatever it is to EAC3 and labels it.
  2.  Labels/Changes the name of this new EAC3 it created.
  3.  Sets the EAC3 as First/Primary track.
  4.  Removes all others tracks that are not English or und.
  5.  Removes subtitles if found.
But sadly does NOT keep the original audio track in the original codec format as a backup.
For example, let's say it converts DTS to EAC3, after it's done the primary track will now be EAC3, all tracks that aren't English will be removed, but the original DTS it used for the EAC3 transcode will be missing. ( I wish for it to stay as a backup, and it should (I thought) seeing it would also be labelled as "English" for language.
Any ideas would be appreciated either via email or via the SuperUser post; as I plan to use ffmpeg for a large project of media and been having issues getting this last bit to work in testing before I through it at the full media library.

More information about the ffmpeg-user mailing list