View previous topic :: View next topic |
Author |
Message |
grooveman Veteran


Joined: 24 Feb 2003 Posts: 1217
|
Posted: Sat Jun 01, 2013 1:31 am Post subject: ffmpeg -- stop that downmixing! |
|
|
Hi everyone.
I'm trying to rip my blu-ray collection so I can box up my blue rays and put them in cold storage and open up some space in the living room.
The only thing I found that did this with any elegance at all is makemkv. But, it doesn't really give you many choices. It pretty much dumps to one type of codec for video, and another for audio, and you are stuck with what it gives you. And, of course, my blu-ray player (which has dlna and can read files from smb/cifs shares on the network) does not recognize either.
So I am using ffmpeg to change the codec to mp4, and the audio to aac. The problem is, that every time I conver, say with a command like this:
Code: | ffmpeg -i title00.mkv -vcodec mpeg4 -acodec aac -sameq -strict -2 /mnt/video/The_Fountain00.mp4 |
It down-mixes the audio to two channels instead of the 5.1 or 7.1. That is no good. I have invested to heavily into my stereo equipment to be stuck with that!
So my question is: How do I convert the audio codec to aac and keep the channel mappings and audio quality. I had hoped that the sameq flag would do the trick, but it isn't. I know there is an "ac" switch... but something tells me that is not enough...
Also, the sound quality from the above issued command is terrible, all garbled, so any advice there is also appreciated.
Thank you for your help
G _________________ To look without without looking within is like looking without without looking at all. |
|
Back to top |
|
 |
FishB8 l33t


Joined: 17 Mar 2003 Posts: 820
|
Posted: Wed Jun 05, 2013 2:38 am Post subject: |
|
|
First, don't use mpeg4 for the video codec. Use x264.
Secondly, your video from the bluray is probably originally in h264 anyway, so you could just copy the video stream and re-encode the audio, which is probably in AC3. (Unless you are wanting to reduce frame-size, which would require re-encoding.
By default the audio channel count for the output is the same as the input, so I suspect your sources only has 2 channels of audio. Use ffprobe on the source to see what is inside it. Also, sometimes you can have multiple audio channels in the same source, so if that is the case ffmpeg might be mapping to a stereo audio stream by default rather than the 5.1/7.1 audio stream that you are wanting. If so, you have to explicitly map the audio stream correctly. _________________ "...as we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously." -Benjamin Franklin |
|
Back to top |
|
 |
grooveman Veteran


Joined: 24 Feb 2003 Posts: 1217
|
Posted: Wed Jun 05, 2013 10:17 am Post subject: |
|
|
Thanks Fish.
Can you tell me a little more about the second option you mentioned?
What do you mean by "just copy the video stream"? And, as far as re-encoding the audio, I thought that is what I was doing... is that what you meant? If you are talking about just using the -copy for the video and audio codec, I have already tried that, and it produces unplayable results on my blu-ray player. Or are you talking about something else here?
Thanks!
G _________________ To look without without looking within is like looking without without looking at all. |
|
Back to top |
|
 |
darklegion Guru

Joined: 14 Nov 2004 Posts: 468
|
Posted: Wed Jun 05, 2013 10:50 am Post subject: |
|
|
Just a comment on your ffmpeg commandline: Don't use "-sameq" it's not same quality, it's same quantizers which probably isn't what you want: http://ffmpeg.org/trac/ffmpeg/wiki/Option%20%27-sameq%27%20does%20NOT%20mean%20%27same%20quality%27
And are you sure your blu-ray player supports mkv? You might try using MP4 as a container instead. The point about mapping the audio stream that Fish mentioned is essentially selecting the correct audio stream. I find the new method quite confusing as well, but it should be explained in the ffmpeg manpage.
Finally, copying means what is sounds like. It means copying the stream without re-encoding it, thus preserving quality and saving you the time and effort to re-encode. |
|
Back to top |
|
 |
FishB8 l33t


Joined: 17 Mar 2003 Posts: 820
|
Posted: Thu Jun 06, 2013 10:54 pm Post subject: |
|
|
grooveman wrote: | Thanks Fish.
Can you tell me a little more about the second option you mentioned?
What do you mean by "just copy the video stream"? And, as far as re-encoding the audio, I thought that is what I was doing... is that what you meant? If you are talking about just using the -copy for the video and audio codec, I have already tried that, and it produces unplayable results on my blu-ray player. Or are you talking about something else here?
Thanks!
|
Bluray can encode the video using several different codecs. However 99% of them use h264. You should be able to dump the video stream into an MP4 container without re-encoding. However the audio in bluray is usually either a dolby format, or AC3, which MP4 containers do not support, which is why you should only have to transcode the audio stream. _________________ "...as we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously." -Benjamin Franklin |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|