LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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



Reply
 
Search this Thread
Old 08-28-2013, 08:59 AM   #16
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 281

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by matrixworld View Post
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
avconv -ss 90 -t 60 -i ./Mus*/14082012205--.mp4 -vn -c:a libmp3lame -b:a 64k testfile2.mp3

sox testfile1.mp3 testfile2.mp3 finalversion.mp3
-----------------
-----------------
If you get any errors from avconv or sox, than it's possible the culprit is the mp4 file. It may have something that avconv doesn't recognize or the file is bad or some unknown reason.
Hi,
The same error this time too with sox. Please see below
Code:
ravbholua@ravbholua-Aspire-5315:~$ sox testfile1.mp3 testfile2.mp3 finalversion.mp3
sox FAIL formats: no handler for file extension `mp3'
ravbholua@ravbholua-Aspire-5315:~$
But 1 more thing, as you told it w'd encode for 1 minute but didn't work so. 1st file testfile1.mp3 is for the total time of 27:28 mimutes and the 2nd one testfile2.mp3 is of 26:29 minutes (i.e. 90 sec less than the total) So the -ss option worked but not -t.
so,you say the culprit may be mp4 file!! That may be possible. But before final conclusion please look at the other point also which I mentioned in my last post. Please note as I mentioned there, I had extracte/cut 2 files from an audio file (amr type) each of 1 minute and your command worked fine.The extracted were also amr type. Now when I added with sox it showed the same error.
Then to verify whether it's issue of the amr type files, I converted the 2 amr files to mp3 file and your command seemed to have worked fine. My previous post details this. Now when I combine these 2 mp3, I get the same error. So, another thought goes that sox may also be a culprit. What you think?
 
Old 08-28-2013, 03:39 PM   #17
matrixworld
LQ Newbie
 
Registered: Aug 2013
Distribution: Sabayon 13.08 (Host), Mint 15 Mate (VM), OpenBSD 5.3 (VM)
Posts: 21

Rep: Reputation: Disabled
Hi

Sorry for the delay in getting back. I think sox doesn't support amr files which is why you get the errors. As I done earlier, I did a test as well with a wav file and got the same error when I tried to convert it to amr. But sox does work with mp3 files.

Quote:
But 1 more thing, as you told it w'd encode for 1 minute but didn't work so. 1st file testfile1.mp3 is for the total time of 27:28 mimutes and the 2nd one testfile2.mp3 is of 26:29 minutes (i.e. 90 sec less than the total) So the -ss option worked but not -t.
The -t should have worked. It's in the man page for avconv.

Quote:
-t duration (output)
Stop writing the output after its duration reaches duration.
duration may be a number in seconds, or in "hh:mm:ss[.xxx]" form.
Quote:
so,you say the culprit may be mp4 file!! That may be possible. But before final conclusion please look at the other point also which I mentioned in my last post. Please note as I mentioned there, I had extracte/cut 2 files from an audio file (amr type) each of 1 minute and your command worked fine.The extracted were also amr type. Now when I added with sox it showed the same error.
Then it's possible that avconv/ffmpeg is not converting the amr file properly to mp3 format. It's as if the mp3 file is still recognize as amr with a mp3 extension.

If avconv/ffmpeg did converted the amr files properly to mp3 format, the sox command would work. Trust me, I do this all the time because I also convert videos full or partial to mp3 files and I also converted other audio files, if recognized, to mp3 format.

I don't know why avconv/ffmpeg is having a hard time converting your amr files to be recognized as mp3 encoded files so that sox can use it and combine them.

Last edited by matrixworld; 08-28-2013 at 04:10 PM.
 
Old 08-28-2013, 04:28 PM   #18
matrixworld
LQ Newbie
 
Registered: Aug 2013
Distribution: Sabayon 13.08 (Host), Mint 15 Mate (VM), OpenBSD 5.3 (VM)
Posts: 21

Rep: Reputation: Disabled
I saw this article online concerning amr files. This could be the reason why avconv/ffmpeg and sox are having trouble with amr files.

http://linux.aldeby.org/post/encode-...in-ubuntu.html

NOTE: This article is dated at 2009. It's possible that the packages it tells you to install might already be available in your repos. I suggest you do an apt-cache search package name before adding the third parties repositories as mentioned in the article.

I suggest you install the libopencore-amrnb0 and libopencore-amrwb0 codecs first because we are only converting amr to mp3. The amrnb and amrwb is needed only for converting audio files to amr format.

After installing the two codecs try again with avconv to convert the amr files to mp3 and sox to combine the mp3 files.

This time avconv should be able to decode the amr files properly because now it has the codecs in its system libraries and it should be able to convert it properly to mp3 format so sox can understand them.

I'll be surprised if it didn't...

Last edited by matrixworld; 08-28-2013 at 05:57 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is it possible to convert the audio and video codecs in a .avi file? damgar Slackware 8 07-20-2012 11:11 PM
How to convert 24-bit audio files to 16-bit .wav and be able to create audio CD. stf92 Linux - Software 13 06-29-2012 02:21 AM
smplayer: video+audio stutters with pulseaudio, audio files play fine GamerX Linux - Desktop 1 02-06-2009 09:53 PM
cut audio and/or video for multiple files vatti Linux - Software 1 03-17-2006 07:21 AM


All times are GMT -5. The time now is 09:41 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration