Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So when I re-code a DVD, I use mencoder to handle the video part and ffmpeg to handle the audio (including mixing 5:1 down to stereo). The reason for the latter is in all the years I've tried, I've never figured out how to get mencoder to extract mix and write just audio.
Got a new DVD. vobcopied it. Identified which VOBs are the one I want. Ran a script to recode just the video part. Nothing new there. Do this all the time. Familiar. No problems. Did not expect any.
Problem: I ran my usual command options with ffmpeg to get audio and ... ffmpeg claims there is no audio stream. That's a new one. And yet somehow ffplay plays the files fine, with sound. Contradiction.
The relevant section of my script (which has worked for ages):
The above is code that has worked for many movies. Seemes the English/first audio track is always 0x:80. I do not see why it would fail now.
Ran mplayer just to see what streams it saw. Hmm, 0x80, 0x81, 0x82, 0x83, yup: four audio streams, named (well, numbered) as usual.
Consultation of the manual reveals that maybe the syntax for ffmpeg's "-map" has changed. Right, so I say "-map 0:0" or even "-map 0:a:0" now? OK, whatever. I make the change. Nope. Still fails. Sigh.
Right: two questions. One: how to accomplish the following ...
Quote:
me: Hey ffmpeg, how ya doing?
ff: Great! How are you?
me: Excellent. hey, I have an input stream for you coming in on stdin.
ff: I can do that!
me: Great. Hey, it's 5:1, you can handle that, right?
ff: Yessir!
me: And it's the first of four known streams, as revealed by mplayer
ff: I don't like mplayer.
me: Well, ffmpeg, you're smarter than mplayer, right? So you can do this, right?
ff: Yes I can!
me: Great, find that audio, mix it to stereo, and send it to a wav file, mmmkay?
ff: Sure thing!
... via command line options to an ffmpeg run.
Failing that, question two:
If mencoder can do this, how? I've never been able to figure this out over several years
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
I don't know if mencoder will extract audio directly from a DVD. But it will from a video file, such as avi or mpg. I don'[t know the exact command line off the top of my head. But try ripping the mpg off the DVD and then get the audio off that.
So after giving up (six months ago) I returned to the problem.
First step: although ffmpeg programs all fail to recognize nor play the audio, ffplay at least indicates that there is audio, in the form of AAC, but zero channels. There is no such thing as audio with zero chaannels, so that' s some indication of the problem. Maybe it is the interleaving of the audio with the video that is funky. So we break the processing of the audio into two tasks.
First task, seperate the audio out, as-is. The raw audio codec data, all by itself in a different container, may work with fflay/ffmpeg. So how to get that? Various search engines, docs, and Trial & error resulted in a way to get that audio out using mencoder:
I took ffplay's word that the audio was AAC and apparently it was, because that command worked. Putting -ni in twice was not a mistake. That was the result of an error message saying I should use -ni. Did so. Got the message again. Put a second -ni in. Then it worked. Go figure.
Turns out that, once the audio was all by itself, suddenly ffplay, and thus ffmpeg, would read it. Great.
The audio was in six channel form. No problem, many DVDs use this and that is familiar ground:
In the above, we mix 5:1 down to stereo, dropping the subsonic track and mixing the center track louder than the others: this makes speech a bit more discernable.
That worked. From then on, usual conversion to a compressed format and remuxing with the video.
Last edited by jr_bob_dobbs; 01-07-2019 at 07:37 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.