Any s/w to cut/add audio files, convert video to audio?
I have below 2 queries please:
a) There are audio files from where I want to cut some portions. for ex. Suppose there is 30 minutes audio file. I want to extract audio from 5 minutes to 8 minutes and from 20 minutes to 24 minutes. Then I want to add these 2 extractions;i.e. it w'd become 7 minutes continues audio [(8-5) + (24-20) = 7 minutes ] b) Also, I want to extract from one video file only audio matter, i.e. convert video to audio. I searched a lot in google a few months back when I was using Windows7. Now I am working on ubuntu13.04. (for my solution, command line from terminal is more preferred) |
a) For these tasks I use Audacity, easy to use, but powerful
b) You can do that with ffmpeg, for example with Code:
ffmpeg -i /path/to/videofile audio.wav |
Thanks TobiSGD. I w'd install both audacity and ffmpeg and see how they work.
|
You can try something like this:
Code:
ffmpeg -ss 00:05:00 -t 00:03:00 -i inputfile -acodec copy outputfile1.ext inputfile is the source file and outputfile.ext is the output file and extension you desire it to be. lastly, the -vn tells ffmpeg to rip audio only minus the video. |
Thank you for your sharing. It works!
|
Quote:
|
Quote:
Code:
ravbholua@ravbholua-Aspire-5315:~$ ffmpeg -i ./Mus*/14082012205--.mp4 -vn check.mp3 But here the problem is the file size of the output file is 54 MB. For nearly 28 minutes audio, 54 MB is very much. I have many files of .amr extensions whose sizes are only 1 MB for the same amount of time. When I give the output file name as .amr extension, it shows the same error. |
@ ravisingh1
When you export a file to wav format they will produce large files, There's no overcoming that. For the second issue, the mp3 format should have worked. It is the most popular codec. I convert videos to mp3 files with ffmpeg with no problem. On some distros ffmpeg is slowly phasing out with it's successor avconv. Have you tried avconv. Also, did you install the ubuntu restricted extras package, This includes the codecs for playing and encoding multimedia files. As for the amr, I have no clue. Sorry |
Quote:
Code:
ravbholua@ravbholua-Aspire-5315:~$ avconv -i ./Mus*/14082012205--.mp4 check.mp3 Code:
avconv -codecs Code:
D A D mp3 MP3 (MPEG audio layer 3) Quote:
|
Hi ravisingh1
To install type this Code:
sudo apt-get update https://help.ubuntu.com/community/RestrictedFormats |
1 Attachment(s)
Quote:
1) After running the above command, after some time a window popped up mentioning "end user aggrement". I scrolled down. in bottom 'OK' was written but clicking it doesn't result in anything. I pressed enter and nothing happened. I did wait for 30 minutes but the same window was in screen and didn't proceed ahead. Then I opened another terminal and via ps -ef command, killed the window. Then the other terminal command proceeded ahead. Please see the result in the screen shot attached. Later I got a message from ubuntu saying that something wasn't isntalled and I clicked "install now" in that message to install the remaining. 2)The command which wasn't earlier working now worked. Please have a look below: Code:
ravbholua@ravbholua-Aspire-5315:~$ avconv -i ./Mus*/14082012205--.mp4 check1.mp3 The output file check1.mp3 created having size of 33.6 MB. But again the same issue of size. You also can understand this is a big size for 28 minutes audio. It's better than .wav file which consumes 54 MB. But still this audio should't be more than 1 MB. The .amr file takes only 1MB. Please see the output of the command when the output file is .amr. This time it hasn't given the previous error (earlier it was saying :no encoder found). But a diff. error. Please see if you can say a solution. Code:
ravbholua@ravbholua-Aspire-5315:~$ avconv -i ./Mus*/14082012205--.mp4 check1.amr |
Quote:
Code:
ravbholua@ravbholua-Aspire-5315:~$ sox out1.mp3 out2.mp3 final.mp3 |
Hi ravisingh1
I'm not familiar with amr and its compression scheme. An mp3 file will be larger than amr format. An average sample rate of 128k will produce 1MB per minute. For example a 4 minute song at 128k will have a file size of around 3 to 5 megabytes. Your 33MB file is just about average for a 28 minute audio. You can however lower the file size by adjusting the sample and bit rates. Fair warn, the lower the sample and bit rate, the audio quality will degarde as well. Try this to resample sample rate and bit rate Code:
ffmpeg -i ./Mus*/14082012205--.mp4 -acodec libmp3lame -ar 22050 -ab 64k check1.mp3 Code:
ffmpeg -i ./Mus*/14082012205--.mp4 -acodec libmp3lame -fs 5M check1.mp3 As for sox, I don't think amr is supported. I also tried to convert a wav file to amr and got the same error as well. However, it does support mp3 files as I've use it sometimes to combine mp3 files together. |
Quote:
Yes you may be right, then it may be a problem from my side which I didn't mention in my last post. That is, the 2 .mp3 files that I was trying to add using "sox" were made from .amr files as shown below: Code:
ravbholua@ravbholua-Aspire-5315:~$ avconv -i out1.amr out1.mp3 |
Hi
Can you try this code with avconv on the mp4 file again. To save time, just encode 1 minute of it for a test. Code:
avconv -ss 0 -t 60 -i ./Mus*/14082012205--.mp4 -vn -c:a libmp3lame -b:a 64k testfile1.mp3 Code:
avconv -i ./Mus*/14082012205--.mp4 -vn -c:a libmp3lame -b:a 64k audio_version.mp3 |
All times are GMT -5. The time now is 04:43 AM. |