VideoHelp Forum

+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 33
Thread
  1. Hi i have ac3 5.1 audio track
    I wanna convert to streo
    How can I do it with ffmpeg?

    By the how many channels in 5.1 audio track
    And a streo track

    I don't know much about audio
    Quote Quote  
  2. Member
    Join Date
    Aug 2006
    Location
    United States
    Search Comp PM
    I'm no expert but did you try a web search for "ffmpeg 5.1 to stereo"?
    I usually try such searches first. Become self sufficient.
    Quote Quote  
  3. Even i also did research but guides which am seeing is confusing lil bit that why I posted here

    In guides i readed something about channels but
    what is channel idk

    May be mono have one channel and streo have 2 channels but not sure...

    And may be 5.1 has 5 channels


    And may be channels affects file size also
    Like more channels means more file size

    Still am not sure about anything ,that's why I need a clear explanation on this topic
    Quote Quote  
  4. If you're happy with the default mapping and levels:

    Code:
    ffmpeg -i input.ac3 -ac 2 output.ext
    Quote Quote  
  5. So -ac specifies channels?

    What if I put only 1 channel
    Then sound will only play in one side of my headphone or both side?

    More channels will make file size bigger?..
    Quote Quote  
  6. Member Skiller's Avatar
    Join Date
    Oct 2013
    Location
    Germany
    Search PM
    Originally Posted by kirito View Post
    By the how many channels in 5.1 audio track
    And a streo track
    A 5.1 AC3 file has 6 channels. Each channel is designated to a speaker. In a standard home cinema setup you would have 6 speakers in total.
    A 2.0 (aka stereo) file has 2 channels for 2 speakers, like headphones and most TVs.

    Downmixing is the process of reducing 6 channels into usually 2 for stereo playback.


    This is more technical, but for playback on stereo equipment such as headphones and TVs I would actually advice not to use a ProLogic compatible downmix (proper term is Lt/Rt), which is often the default. Reason is it mixes the two surround channels equally into both, left and right, therefore removing the ability to discern left and right sounds of the original surround channels. They would just appear to be in the middle then. For stereo playback a Lo/Ro downmix (often labeled "Stereo") yields better results.
    Quote Quote  
  7. Originally Posted by kirito View Post
    So -ac specifies channels?
    Yes. 2 channels = stereo

    Originally Posted by kirito View Post
    What if I put only 1 channel
    Then sound will only play in one side of my headphone or both side?
    One channel is mono. Most players will play on both sides of a stereo system.

    Originally Posted by kirito View Post
    More channels will make file size bigger?..
    It depends on what type of encoding you do. Uncompressed WAV? Yes, more channels means more data. With most compressed formats the bitrate determines the size, not the number of channels. For example MP3 at 128 kbps will deliver the same size for mono and stereo -- but the mono track may sound better at the same size.
    Quote Quote  
  8. For smartphones/mobile phones how many channels are used widely?
    Quote Quote  
  9. Originally Posted by jagabo View Post
    If you're happy with the default mapping and levels:

    Code:
    ffmpeg -i input.ac3 -ac 2 output.ext

    -ac 1 will make my audio track mono?
    Quote Quote  
  10. Why don't you try it and find out?
    Quote Quote  
  11. Whenever i try ,i find something new errors
    Whatever I'll try it in this evening and give error reports
    Last edited by kirito; 2nd Jan 2022 at 02:50.
    Quote Quote  
  12. when i tried to encode my ac3 5.1 audio to opus 32k with this code

    Code:
    ffmpeg -i input.ac3 -c:a libopus -b:a 32k output.opus
    it give me this error

    Image
    [Attachment 62681 - Click to enlarge]


    then i did some research on this error

    https://trac.ffmpeg.org/ticket/5718

    on this site it says i have to add -af "channelmap=channel_layout=5.1" to my code




    then i tried encoding this this code

    Code:
    ffmpeg -i input.ac3 -c:a libopus -b:a 32k -af "channelmap=channel_layout=5.1" output.opus
    Image
    [Attachment 62682 - Click to enlarge]


    it worked but output sound quality was to much badd





    then i looked at this guide

    https://trac.ffmpeg.org/wiki/Encode/AAC

    Image
    [Attachment 62683 - Click to enlarge]



    it says with -ac 2 this code we can also do it




    so i tried encoding with this code

    Code:
    ffmpeg -i input.ac3 -c:a libopus -b:a 32k -ac 2 output.opus
    it also worked and output sound quality was also too good

    Image
    [Attachment 62684 - Click to enlarge]








    now my question is with
    -af "channelmap=channel_layout=5.1" this code why sound qaulity bad and with,
    -ac 2 this code sound qaulity good






    i checked both output files codecs information in vlc player
    -af "channelmap=channel_layout=5.1"
    output.opus codec information
    Image
    [Attachment 62685 - Click to enlarge]




    -ac 2 output codec information
    Image
    [Attachment 62686 - Click to enlarge]





    what does
    -af "channelmap=channel_layout=5.1" this code do? and
    -ac 2 this code
    Quote Quote  
  13. Blu-Disc Studio developer
    Join Date
    Oct 2013
    Location
    blu-disc.net
    Search PM
    why not to use eac3to?
    Quote Quote  
  14. Originally Posted by CDK View Post
    why not to use eac3to?
    Because i am interested in ffmpeg cli
    Quote Quote  
  15. Originally Posted by jagabo View Post
    If you're happy with the default mapping and levels:

    Code:
    ffmpeg -i input.ac3 -ac 2 output.ext
    What are default mapping and levels settings?
    Quote Quote  
  16. Originally Posted by kirito View Post
    now my question is with
    -af "channelmap=channel_layout=5.1" this code why sound qaulity bad
    32k isn't enough bitrate for six audio channels. Add -ac 1 to mix it down to one channel.

    Code:
    ffmpeg -i input.ac3 -af "channelmap=channel_layout=5.1" -ac 1 -c:a libopus -b:a 32k output.opus
    Quote Quote  
  17. Originally Posted by kirito View Post
    Originally Posted by jagabo View Post
    If you're happy with the default mapping and levels:

    Code:
    ffmpeg -i input.ac3 -ac 2 output.ext
    What are default mapping and levels settings?
    Code:
    -af "pan=stereo|FL < 1.0*FL + 0.707*FC + 0.707*BL|FR < 1.0*FR + 0.707*FC + 0.707*BR"
    Quote Quote  
  18. Originally Posted by jagabo View Post
    Originally Posted by kirito View Post
    now my question is with
    -af "channelmap=channel_layout=5.1" this code why sound qaulity bad
    32k isn't enough bitrate for six audio channels. Add -ac 1 to mix it down to one channel.

    Code:
    ffmpeg -i input.ac3 -af "channelmap=channel_layout=5.1" -ac 1 -c:a libopus -b:a 32k output.opus

    -ac 1 will make my audio mono?

    And -af="channelmap=channel_layout=5.1" is it necessary to write?..i mean what if i only use -ac 1 code and skip -af code is it ok?
    Quote Quote  
  19. Use clever Ffmpeg-GUI.
    Load your video, click main, click convert audio, select your ac3 5.1 track, click continue, set channels to the special 5.1 to 2 setting (it's an improved downmix algorythm), click convert, done.

    Image
    [Attachment 62719 - Click to enlarge]
    Last edited by ProWo; 3rd Jan 2022 at 04:23.
    Quote Quote  
  20. For audio video conversion encoding i like cli better then gui because -
    Cli = can do everything
    Gui = can do limited things
    Quote Quote  
  21. Originally Posted by kirito View Post
    For audio video conversion encoding i like cli better then gui because -
    Cli = can do everything
    Gui = can do limited things
    Then convert your ac3 5.1 with your client to stereo.
    Quote Quote  
  22. Originally Posted by ProWo View Post
    Originally Posted by kirito View Post
    For audio video conversion encoding i like cli better then gui because -
    Cli = can do everything
    Gui = can do limited things
    Then convert your ac3 5.1 with your client to stereo.

    Yea I did it with this code but not sure it's perfect or not

    Code:
    ffmpeg -i -input.ac3 -ac 2 output.ac3
    Quote Quote  
  23. When you do the mix down to 2 channel stereo, be sure to also include Dynamic Range Compression otherwise the audio from the satellite speakers will drown out the main central speaker. This happens alot on youtube where people directly upload their dvdrips and just leave it to be auto processed by the youtube software - the result is that the background music drowns out segments of narration and where people speak to each other.
    Quote Quote  
  24. Originally Posted by kirito View Post
    I did it with this code but not sure it's perfect or not

    Code:
    ffmpeg -i -input.ac3 -ac 2 output.ac3
    There is no perfect, just choices. If you don't like the standard downmix (see post #17) you can specify the parameters yourself.

    https://ffmpeg.org/ffmpeg-filters.html#pan-1

    A lot of people like to boost the center channel (as suggested by sageone) for more prominent dialog.
    Quote Quote  
  25. Retired Hippie Ax Slinger Axel Slingerland's Avatar
    Join Date
    Jul 2020
    Location
    The Lost Coast
    Search Comp PM
    Originally Posted by jagabo View Post
    2 channels = stereo
    Based on the dictionary description, yes. But if you ask a musician they will say it's not stereo. We say that if a track was mono to begin with, giving it two channels doesn't necessarily make it stereo. In that case it's two channel mono. Who is right? It all depends on your opinion, I suppose. Musicians believe that if the audio signal is duplicated in both Left and Right channels, then it the output is two channel mono. Stereo is two different unique audio signals in the Left and Right channels. As an example, would Pink Floyd's Dark Side Of The Moon be as enjoyable to listen to in two channel mono as it is in stereo? Or more importantly, would you buy a 5.1 or 7.1 speaker system if all speakers had the exact same sound? I wouldn't. You would have 6 or 8 speakers that all sound the same, with no bass, no sweeping sound effects, and as such not worth the big bucks a set of speakers like that cost. This is just my musician's opinion...
    Quote Quote  
  26. For the purposes described here, downmixing a 5.1 source with the given ffmpeg command, 2 channels = stereo. Unless of course the 5.1 source is mono.
    Last edited by jagabo; 12th Jan 2022 at 22:46.
    Quote Quote  
  27. Retired Hippie Ax Slinger Axel Slingerland's Avatar
    Join Date
    Jul 2020
    Location
    The Lost Coast
    Search Comp PM
    I did say IF a source was mono...
    Quote Quote  
  28. My source audio 5.1 has 6 channels and all channel has different signals.....
    So if i downmix to 2 channel then I'll get left and right channel with same signals or both will have different signals??
    Quote Quote  
  29. Originally Posted by kirito View Post
    My source audio 5.1 has 6 channels and all channel has different signals.....
    So if i downmix to 2 channel then I'll get left and right channel with same signals or both will have different signals??
    You've already been told what the default downmix is in post #17. You could just read the documentation:

    https://ffmpeg.org/ffmpeg-filters.html#pan-1
    https://trac.ffmpeg.org/wiki/AudioChannelManipulation

    Or you could just try it and find out for yourself.

    Axel Slingerland should never have brought this up. All it's doing is confusing you.
    Last edited by jagabo; 13th Jan 2022 at 09:31.
    Quote Quote  
  30. Retired Hippie Ax Slinger Axel Slingerland's Avatar
    Join Date
    Jul 2020
    Location
    The Lost Coast
    Search Comp PM
    I was just making friendly conversation. But your response isn't. So never mind.
    Quote Quote