VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 33
Thread
  1. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    I need to convert audio inside an mkv container from DD+ (E-AC-3) to AC-3. I am assuming that I need to extract, convert and then add the audio back to the mkv container. Is there a tool that makes this task easier?
    Quote Quote  
  2. Originally Posted by kyrcy View Post
    I need to convert audio inside an mkv container from DD+ (E-AC-3) to AC-3. I am assuming that I need to extract, convert and then add the audio back to the mkv container. Is there a tool that makes this task easier?
    I would use ffmpeg with simple batch but perhaps somebody will recommend you some GUI tool.

    Code:
    ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -c:v copy -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    Quote Quote  
  3. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    Originally Posted by pandy View Post
    I would use ffmpeg with simple batch but perhaps somebody will recommend you some GUI tool.

    Code:
    ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -c:v copy -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    Thanks for the batch, it appears to be working. As I have no experience with the options for ffmpeg, a GUI tool would be nice. For example, how do I keep both audio tracks?
    Quote Quote  
  4. Originally Posted by kyrcy View Post
    Originally Posted by pandy View Post
    I would use ffmpeg with simple batch but perhaps somebody will recommend you some GUI tool.

    Code:
    ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -c:v copy -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    Thanks for the batch, it appears to be working. As I have no experience with the options for ffmpeg, a GUI tool would be nice. For example, how do I keep both audio tracks?
    Try this:

    Code:
    ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -c:v copy -map 0:a -c:a copy -map 0:a -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    Quote Quote  
  5. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    eac3to with gui will encode to ac3.
    I think,therefore i am a hamster.
    Quote Quote  
  6. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    Originally Posted by johns0 View Post
    eac3to with gui will encode to ac3.
    I already tried it, but could not figure out how to make it work.
    Quote Quote  
  7. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    Originally Posted by pandy View Post
    Originally Posted by kyrcy View Post
    Originally Posted by pandy View Post
    I would use ffmpeg with simple batch but perhaps somebody will recommend you some GUI tool.

    Code:
    ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -c:v copy -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    Thanks for the batch, it appears to be working. As I have no experience with the options for ffmpeg, a GUI tool would be nice. For example, how do I keep both audio tracks?
    Try this:

    Code:
    ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -c:v copy -map 0:a -c:a copy -map 0:a -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    It does not work correctly, as the mkv contains only the AC-3 track twice.
    Quote Quote  
  8. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    Download the latest eac3to and use this gui,the newer gui is confusing.
    Image Attached Files
    I think,therefore i am a hamster.
    Quote Quote  
  9. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    Originally Posted by johns0 View Post
    Download the latest eac3to and use this gui,the newer gui is confusing.
    I don't see an option for converting E-AC-3 to AC-3. Am I missing something?
    Quote Quote  
  10. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    In the second tab save as type ac3,make sure you set all the path to mkvmerge/tsmuxer and eac3to in the first tab.
    I think,therefore i am a hamster.
    Quote Quote  
  11. Originally Posted by kyrcy View Post
    It does not work correctly, as the mkv contains only the AC-3 track twice.
    Correct would be something like this:
    Code:
    ffmpeg -i "input.mkv" -map 0:v -map 0:a:0 -map 0:a:0 -c:v copy -c:a:0 copy -c:a:1 ac3  "output.mkv"

    See:
    https://ffmpeg.org/ffmpeg.html#Stream-specifiers
    https://trac.ffmpeg.org/wiki/Map
    Quote Quote  
  12. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    Originally Posted by johns0 View Post
    In the second tab save as type ac3,make sure you set all the path to mkvmerge/tsmuxer and eac3to in the first tab.
    The gui is still confusing as the buttons are truncated when using my 4k monitor.
    Quote Quote  
  13. Originally Posted by kyrcy View Post
    Originally Posted by pandy View Post
    Originally Posted by kyrcy View Post
    Originally Posted by pandy View Post
    I would use ffmpeg with simple batch but perhaps somebody will recommend you some GUI tool.

    Code:
    ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -c:v copy -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    Thanks for the batch, it appears to be working. As I have no experience with the options for ffmpeg, a GUI tool would be nice. For example, how do I keep both audio tracks?
    Try this:

    Code:
    ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -c:v copy -map 0:a -c:a copy -map 0:a -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    It does not work correctly, as the mkv contains only the AC-3 track twice.
    Sorry, my fault, didn't tested, sneaker is right it should be something like this (tested with few different sources):

    Code:
    @ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -map 0:v -c:v copy -map 0:a -c:a:0 copy -filter_complex [0:a:0]"aresample=resampler=soxr:osr=48000:cutoff=0.990:dither_method=0"[a2c] -map [a2c]:1 -c:a:1 ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"
    It should always convert first audio track to ac3 even if for example source sample rate is not supported by AC-3 (perhaps not the case for EAC-3 but for sure case for Dolby True HD)... If you don't like idea to resample you can safely replace"aresample=..." with "anull"
    Quote Quote  
  14. Member
    Join Date
    Jul 2008
    Location
    Old Dominion
    Search Comp PM
    XMedia Recode (free) and myFFmpeg (shareware) will do it. No extraction and remuxing required.
    Last edited by mail2tom; 16th Jun 2019 at 18:51.
    Quote Quote  
  15. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    I will give XMedia Recode a try next time I will need to convert.
    Quote Quote  
  16. Member
    Join Date
    Jun 2019
    Location
    US East
    Search Comp PM
    First post, yeah!

    I do this a lot. My LG player does not do E-AC3. Here is a batch (.bat) file I wrote.

    File: Fix TV Show.bat
    Code:
    @echo off
    title %~n0
    
    FOR %%I IN (%*) DO nice ffmpeg -i "%%~fI" -vcodec copy -acodec ac3 -abr 640 -sn "%%~dI%%~pI\%%~nI.fixed%%~xI"
    pause
    The syntax is a little archaic but works fine with ffmpeg version 4.1.1.
    If you don't have 'nice.exe' just remove the 'nice' from above.

    I've used this many times and it produces MKV files that my picky player can play.
    Quote Quote  
  17. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    Originally Posted by mail2tom View Post
    XMedia Recode (free) and myFFmpeg (shareware) will do it. No extraction and remuxing required.
    I don't see how to convert E-AC-3 to AC-3 in XMedia Recode. Am I missing something?
    Originally Posted by mpierc View Post
    First post, yeah!

    I do this a lot. My LG player does not do E-AC3. Here is a batch (.bat) file I wrote.

    File: Fix TV Show.bat
    Code:
    @echo off
    title %~n0
    
    FOR %%I IN (%*) DO nice ffmpeg -i "%%~fI" -vcodec copy -acodec ac3 -abr 640 -sn "%%~dI%%~pI\%%~nI.fixed%%~xI"
    pause
    The syntax is a little archaic but works fine with ffmpeg version 4.1.1.
    If you don't have 'nice.exe' just remove the 'nice' from above.

    I've used this many times and it produces MKV files that my picky player can play.
    How do I get the best audio quality possible?
    Last edited by kyrcy; 19th Jul 2019 at 11:27.
    Quote Quote  
  18. Originally Posted by kyrcy View Post
    How do I get the best audio quality possible?
    For AC3 bitrate 448kbps or higher accordingly to EBU tests deliver excellent quality:

    Dolby Digital requires 448 kbit/s and DTS still requires around 1.5 Mbit/s for
    "Excellent" quality.
    (DTS 1500kbps)

    https://tech.ebu.ch/docs/tech/tech3324.pdf
    https://tech.ebu.ch/docs/tech/tech3339.pdf

    Dolby Digital (AC3) 512 or 640kbps should deliver overall quality that can be considered from consumer perspective as subjectively lossless.
    Quote Quote  
  19. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    Originally Posted by pandy View Post
    Originally Posted by kyrcy View Post
    How do I get the best audio quality possible?
    For AC3 bitrate 448kbps or higher accordingly to EBU tests deliver excellent quality:

    Dolby Digital requires 448 kbit/s and DTS still requires around 1.5 Mbit/s for
    "Excellent" quality.
    (DTS 1500kbps)

    https://tech.ebu.ch/docs/tech/tech3324.pdf
    https://tech.ebu.ch/docs/tech/tech3339.pdf

    Dolby Digital (AC3) 512 or 640kbps should deliver overall quality that can be considered from consumer perspective as subjectively lossless.
    How to I change the bitrate? For some reason subtitles (other than English) are removed after running the batch.
    Quote Quote  
  20. Originally Posted by kyrcy View Post
    How to I change the bitrate? For some reason subtitles (other than English) are removed after running the batch.
    Change bitrate where? Provide useful details.
    Quote Quote  
  21. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    I mean how do I set the bitrate in the batch files above using ffmpeg? Also as I wrote your batch seems to also remove subtitles (other than English) in addition to the E-AC-3 track.
    Quote Quote  
  22. Map/copy the subtitles you want. (e.g. -map 0:s -c:s copy to copy all subtitles from the first input file to output.)
    Set audio bitrate via -b:a (e.g. -b:a 640k to set audio bitrate to 640k for all audio outputs.)
    https://ffmpeg.org/ffmpeg-codecs.html#Codec-Options
    Quote Quote  
  23. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    c:\progra~1\ffmpeg-4.1.3-win64-static\bin\ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -map 0:s -c:v copy -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"

    I get the message:

    Stream map '0:s' matches no streams.
    To ignore this, add a trailing '?' to the map.

    What am I doing wrong?
    Quote Quote  
  24. Code:
    -map 0:s
    tells ffmpeg to map the subtitle from input 0 to the output,
    try changing it to:
    Code:
    -map 0:s?
    iirc that should tell ffmpeg to ignore the subtitle mapping in case the source has no subtitles.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  25. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    c:\progra~1\ffmpeg-4.1.3-win64-static\bin\ffmpeg.exe -hide_banner -v 32 -stats -y -i %1 -map 0:s? -c:v copy -c:a ac3 -b:a 384k -f matroska "%~n1_ac3.mkv"

    It's not working correctly as the resulting mkv only contains subtitles.
    Quote Quote  
  26. Okay. What happens if you use '-c:s copy' instead ?
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  27. Member
    Join Date
    Aug 2005
    Location
    Europe
    Search PM
    Resulting mkv is slightly smaller but still contains only subtitles.
    Quote Quote  
  28. '-c copy' should tell ffmpeg to copy the subtitles '-c:v copy' tells it to copy the video and '-c:a ac3 -b:a 384k' tells it to convert the audio to ac3 with a bitrate of 384kBit/s.
    No clue why the output would only contain the subtitles.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  29. If you use -map then the default mapping is overriden. I.e. you need:
    Code:
    -map 0:v? -map 0:a? -map 0:s? -c:v copy -c:a ac3 -b:a 384k -c:s copy
    or something along those lines.
    Quote Quote  
  30. Yeah, but by replacing the "-map:s" with "-c:s copy" didn't solve it for him, which is what wonders me.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!