Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #205078 > unrolled thread

how to select part of old mp3 and create new one

Started byLong Wind <longwind2@yahoo.com>
First post2019-02-07 08:10 +0100
Last post2019-02-07 13:50 +0100
Articles 17 — 9 participants

Back to article view | Back to linux.debian.user

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  how to select part of old mp3 and create new one Long Wind <longwind2@yahoo.com> - 2019-02-07 08:10 +0100
    Re: how to select part of old mp3 and create new one mick crane <mick.crane@gmail.com> - 2019-02-07 09:40 +0100
      Re: how to select part of old mp3 and create new one <tomas@tuxteam.de> - 2019-02-07 10:00 +0100
        Re: how to select part of old mp3 and create new one Long Wind <longwind2@yahoo.com> - 2019-02-07 10:20 +0100
          Re: how to select part of old mp3 and create new one <tomas@tuxteam.de> - 2019-02-07 10:40 +0100
        Re: how to select part of old mp3 and create new one Nicolas George <george@nsup.org> - 2019-02-07 10:30 +0100
          Re: how to select part of old mp3 and create new one tomas@tuxteam.de - 2019-02-07 10:40 +0100
            Re: how to select part of old mp3 and create new one Jude DaShiell <jdashiel@panix.com> - 2019-02-07 18:40 +0100
              Re: how to select part of old mp3 and create new one tomas@tuxteam.de - 2019-02-07 18:50 +0100
                Re: how to select part of old mp3 and create new one Jude DaShiell <jdashiel@panix.com> - 2019-02-07 19:00 +0100
          Re: how to select part of old mp3 and create new one Long Wind <longwind2@yahoo.com> - 2019-02-07 11:00 +0100
    Re: how to select part of old mp3 and create new one Michael Lange <klappnase@freenet.de> - 2019-02-07 10:00 +0100
    Re: how to select part of old mp3 and create new one songbird <songbird@anthive.com> - 2019-02-07 12:20 +0100
      Re: how to select part of old mp3 and create new one Long Wind <longwind2@yahoo.com> - 2019-02-07 13:20 +0100
        Re: how to select part of old mp3 and create new one songbird <songbird@anthive.com> - 2019-02-07 13:50 +0100
      Re: how to select part of old mp3 and create new one Curt <curty@free.fr> - 2019-02-07 13:30 +0100
        (solved)Re: how to select part of old mp3 and create new one Long Wind <longwind2@yahoo.com> - 2019-02-07 13:50 +0100

#205078 — how to select part of old mp3 and create new one

FromLong Wind <longwind2@yahoo.com>
Date2019-02-07 08:10 +0100
Subjecthow to select part of old mp3 and create new one
Message-ID<xoLYS-6Ke-3@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

i want to copy part of old mp3 file and create a new oneat first, i install lame, but it doesn't seem to have such abilityi try mencoder, it doesn't eitherthen i try qmp3cut, it says "no valid header found"though i can play the mp3 file and it's OK
what should i do next? Thanks!

[toc] | [next] | [standalone]


#205080

Frommick crane <mick.crane@gmail.com>
Date2019-02-07 09:40 +0100
Message-ID<xoNnX-7tz-1@gated-at.bofh.it>
In reply to#205078
On 2019-02-07 07:08, Long Wind wrote:
> i want to copy part of old mp3 file and create a new oneat first, i
> install lame, but it doesn't seem to have such abilityi try mencoder,
> it doesn't eitherthen i try qmp3cut, it says "no valid header
> found"though i can play the mp3 file and it's OK
> what should i do next? Thanks!

ffmpeg

don't have exact syntax to hand

-- 
Key ID    4BFEBB31

[toc] | [prev] | [next] | [standalone]


#205081

From<tomas@tuxteam.de>
Date2019-02-07 10:00 +0100
Message-ID<xoNHj-7Av-1@gated-at.bofh.it>
In reply to#205080

[Multipart message — attachments visible in raw view] — view raw

On Thu, Feb 07, 2019 at 08:33:15AM +0000, mick crane wrote:
> On 2019-02-07 07:08, Long Wind wrote:
> >i want to copy part of old mp3 file and create a new oneat first, i
> >install lame, but it doesn't seem to have such abilityi try mencoder,
> >it doesn't eitherthen i try qmp3cut, it says "no valid header
> >found"though i can play the mp3 file and it's OK
> >what should i do next? Thanks!
> 
> ffmpeg
> 
> don't have exact syntax to hand

ffmpeg's man page is pretty complete, but pretty daunting too. Here's
a command line to help jump-start things (corrections/enhancements
welcome):

  ffmpeg -i input.mp3 -ss 10 -t 20 -acodec mp3 output.mp3

This is assuming you want to have your result as .mp3 too (consider
a free codec like vorbis or flac, if you want lossless).

Here's a rundown of the above command line:

  -i input.mp3  -- the input file. Replace by "your" name

  -ss 10        -- the start time (in seconds). You can use a
                   duration in the hh:mm:ss.ffff format (cf.
                   man page ffmpeg-utils(1)

  -t 20         -- the duration (just leave it out if you want
                   copy all to the end). Format as above.

  -acodec mp3   -- the audio codec for output. See ffmpeg man
                   page for possibilities (audio & video codecs
                   have options of their own, lots of fun for
                   long winter afternoons :-)

  output.mp3    -- your desired output file name

Cheers
-- t

[toc] | [prev] | [next] | [standalone]


#205086

FromLong Wind <longwind2@yahoo.com>
Date2019-02-07 10:20 +0100
Message-ID<xoO0F-7WN-1@gated-at.bofh.it>
In reply to#205081

[Multipart message — attachments visible in raw view] — view raw

Thank tomas!i've just tested your command, it's OK
Thank crane and Michael too! 

    On Thursday, February 7, 2019 4:55 PM, "tomas@tuxteam.de" <tomas@tuxteam.de> wrote:
 

 On Thu, Feb 07, 2019 at 08:33:15AM +0000, mick crane wrote:
> On 2019-02-07 07:08, Long Wind wrote:
> >i want to copy part of old mp3 file and create a new oneat first, i
> >install lame, but it doesn't seem to have such abilityi try mencoder,
> >it doesn't eitherthen i try qmp3cut, it says "no valid header
> >found"though i can play the mp3 file and it's OK
> >what should i do next? Thanks!
> 
> ffmpeg
> 
> don't have exact syntax to hand

ffmpeg's man page is pretty complete, but pretty daunting too. Here's
a command line to help jump-start things (corrections/enhancements
welcome):

  ffmpeg -i input.mp3 -ss 10 -t 20 -acodec mp3 output.mp3

This is assuming you want to have your result as .mp3 too (consider
a free codec like vorbis or flac, if you want lossless).

Here's a rundown of the above command line:

  -i input.mp3  -- the input file. Replace by "your" name

  -ss 10        -- the start time (in seconds). You can use a
                  duration in the hh:mm:ss.ffff format (cf.
                  man page ffmpeg-utils(1)

  -t 20        -- the duration (just leave it out if you want
                  copy all to the end). Format as above.

  -acodec mp3  -- the audio codec for output. See ffmpeg man
                  page for possibilities (audio & video codecs
                  have options of their own, lots of fun for
                  long winter afternoons :-)

  output.mp3    -- your desired output file name

Cheers
-- t

   

[toc] | [prev] | [next] | [standalone]


#205092

From<tomas@tuxteam.de>
Date2019-02-07 10:40 +0100
Message-ID<xoOk1-83z-17@gated-at.bofh.it>
In reply to#205086

[Multipart message — attachments visible in raw view] — view raw

On Thu, Feb 07, 2019 at 09:14:50AM +0000, Long Wind wrote:
> Thank tomas!i've just tested your command, it's OK

Thanks :-)

But see Nicolas's reply too: his version is probably faster
and its result will have better quality.

Cheers
-- tomás

[toc] | [prev] | [next] | [standalone]


#205089

FromNicolas George <george@nsup.org>
Date2019-02-07 10:30 +0100
Message-ID<xoOam-80b-15@gated-at.bofh.it>
In reply to#205081

[Multipart message — attachments visible in raw view] — view raw

tomas@tuxteam.de (12019-02-07):
>   ffmpeg -i input.mp3 -ss 10 -t 20 -acodec mp3 output.mp3

Since the original is already in MP3, -acodec copy (or -c:a copy, more
modern) will avoid re-encoding the file, and thus having the MP3
artifacts twice.

But if you want to recode, then do not put just a codec: you would get
the default quality parameters, and they probably do not suit you.
Specify the quality you want. RTFM for that.

Last: usually better to put -ss before -i, because it avoids decoding
the whole beginning of the file.

> This is assuming you want to have your result as .mp3 too (consider
> a free codec like vorbis or flac, if you want lossless).

Nowadays, Opus beats Vorbis easily.

Regards,

-- 
  Nicolas George

[toc] | [prev] | [next] | [standalone]


#205091

Fromtomas@tuxteam.de
Date2019-02-07 10:40 +0100
Message-ID<xoOk1-83z-1@gated-at.bofh.it>
In reply to#205089

[Multipart message — attachments visible in raw view] — view raw

On Thu, Feb 07, 2019 at 10:19:39AM +0100, Nicolas George wrote:
> tomas@tuxteam.de (12019-02-07):
> >   ffmpeg -i input.mp3 -ss 10 -t 20 -acodec mp3 output.mp3
> 
> Since the original is already in MP3, -acodec copy (or -c:a copy, more
> modern) will avoid re-encoding the file, and thus having the MP3
> artifacts twice.

Yes, this is a very important point. More speed at more quality,
this is an offer one can't decline :-)

> But if you want to recode, then do not put just a codec: you would get
> the default quality parameters, and they probably do not suit you.
> Specify the quality you want. RTFM for that.

Yes. I just wanted to present a somewhat minimalist command line
to grow from.

> Last: usually better to put -ss before -i, because it avoids decoding
> the whole beginning of the file.

Nice little optimization, right. With videos and not-that-fast
hardware it'll make a noticeable difference, I guess.

> > This is assuming you want to have your result as .mp3 too (consider
> > a free codec like vorbis or flac, if you want lossless).
> 
> Nowadays, Opus beats Vorbis easily.

Thanks for the heads-up. I'm not that deep in codec land these days.

Thanks for your comments!

Cheers
-- tomás

[toc] | [prev] | [next] | [standalone]


#205114

FromJude DaShiell <jdashiel@panix.com>
Date2019-02-07 18:40 +0100
Message-ID<xoVOx-4aA-9@gated-at.bofh.it>
In reply to#205091
I wonder, would recoding the file put a proper header on any new file
created?  If not, do any tools exist capable of syntax checking an mp3
file with a missing header and then adding a proper header to that mp3
file?



--

[toc] | [prev] | [next] | [standalone]


#205115

Fromtomas@tuxteam.de
Date2019-02-07 18:50 +0100
Message-ID<xoVYd-4e4-5@gated-at.bofh.it>
In reply to#205114

[Multipart message — attachments visible in raw view] — view raw

On Thu, Feb 07, 2019 at 12:30:48PM -0500, Jude DaShiell wrote:
> I wonder, would recoding the file put a proper header on any new file
> created?  If not, do any tools exist capable of syntax checking an mp3
> file with a missing header and then adding a proper header to that mp3
> file?

Depending on what you (or your software) considers to be a "header":
If it's the ID3 stuff, then something like exiftool might do the
trick. If you mean /strictly/ MP3 headers, then MP3 seems to be
a multi-headed monster (each frame has a header [1], and I doubt any
frame would really make sense without one)

Cheers

[1] https://en.wikipedia.org/wiki/Mp3#File_structure
-- t

[toc] | [prev] | [next] | [standalone]


#205116

FromJude DaShiell <jdashiel@panix.com>
Date2019-02-07 19:00 +0100
Message-ID<xoW7T-4hF-1@gated-at.bofh.it>
In reply to#205115
On Thu, 7 Feb 2019, tomas@tuxteam.de wrote:

> Date: Thu, 7 Feb 2019 12:45:45
> From: tomas@tuxteam.de
> To: Jude DaShiell <jdashiel@panix.com>
> Cc: debian-user@lists.debian.org
> Subject: Re: how to select part of old mp3 and create new one
>
> On Thu, Feb 07, 2019 at 12:30:48PM -0500, Jude DaShiell wrote:
> > I wonder, would recoding the file put a proper header on any new file
> > created?  If not, do any tools exist capable of syntax checking an mp3
> > file with a missing header and then adding a proper header to that mp3
> > file?
>
> Depending on what you (or your software) considers to be a "header":
> If it's the ID3 stuff, then something like exiftool might do the
> trick. If you mean /strictly/ MP3 headers, then MP3 seems to be
> a multi-headed monster (each frame has a header [1], and I doubt any
> frame would really make sense without one)
>
> Cheers
>
> [1] https://en.wikipedia.org/wiki/Mp3#File_structure
> -- t
>
I wonder what file (1) has to say about longwind's old mp3 file?  Is file
more capable than that package longwind used and got no header error?


--

[toc] | [prev] | [next] | [standalone]


#205094

FromLong Wind <longwind2@yahoo.com>
Date2019-02-07 11:00 +0100
Message-ID<xoODo-8ag-7@gated-at.bofh.it>
In reply to#205089

[Multipart message — attachments visible in raw view] — view raw

Thank Nicolas George!i've tested copy optionindeed it's faster than mp3 encoding.
 

    On Thursday, February 7, 2019 5:20 PM, Nicolas George <george@nsup.org> wrote:
 

 tomas@tuxteam.de (12019-02-07):
>  ffmpeg -i input.mp3 -ss 10 -t 20 -acodec mp3 output.mp3

Since the original is already in MP3, -acodec copy (or -c:a copy, more
modern) will avoid re-encoding the file, and thus having the MP3
artifacts twice.

But if you want to recode, then do not put just a codec: you would get
the default quality parameters, and they probably do not suit you.
Specify the quality you want. RTFM for that.

Last: usually better to put -ss before -i, because it avoids decoding
the whole beginning of the file.

> This is assuming you want to have your result as .mp3 too (consider
> a free codec like vorbis or flac, if you want lossless).

Nowadays, Opus beats Vorbis easily.

Regards,

-- 
  Nicolas George

   

[toc] | [prev] | [next] | [standalone]


#205082

FromMichael Lange <klappnase@freenet.de>
Date2019-02-07 10:00 +0100
Message-ID<xoNHj-7Av-3@gated-at.bofh.it>
In reply to#205078
Hi,

On Thu, 7 Feb 2019 07:08:26 +0000 (UTC)
Long Wind <longwind2@yahoo.com> wrote:

> i want to copy part of old mp3 file and create a new oneat first, i
> install lame, but it doesn't seem to have such abilityi try mencoder,
> it doesn't eitherthen i try qmp3cut, it says "no valid header
> found"though i can play the mp3 file and it's OK what should i do next?
> Thanks!
> 

as Mick pointed out ffmpeg should be able to do this if you figure out
the suitable command line. If you prefer a gui, I think audacity should
be able to do this, and it might be easier to determine the desired start
and end points from a gui.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Most legends have their basis in facts.
		-- Kirk, "And The Children Shall Lead", stardate 5029.5

[toc] | [prev] | [next] | [standalone]


#205098

Fromsongbird <songbird@anthive.com>
Date2019-02-07 12:20 +0100
Message-ID<xoPSN-DP-3@gated-at.bofh.it>
In reply to#205078
Long Wind wrote:
...
> i want to copy part of old mp3 file and create a new oneat first, i install lame, but it doesn't seem to have such abilityi try mencoder, it doesn't eitherthen i try qmp3cut, it says "no valid header found"though i can play the mp3 file and it's OK
> what should i do next? Thanks!

  not post in html...  :(


  that aside...

  does it have to be mp3 ?

  i convert all audios to flac before i do anything else
with them.

  pacpl will do conversions.

  once i have flac then i can edit with any audio editor
that does flac.  i like mhwaveedit.


  songbird

[toc] | [prev] | [next] | [standalone]


#205101

FromLong Wind <longwind2@yahoo.com>
Date2019-02-07 13:20 +0100
Message-ID<xoQOR-1do-7@gated-at.bofh.it>
In reply to#205098

[Multipart message — attachments visible in raw view] — view raw

Thank songbird, i think mp3 is popular and supported by many devices, and it satisfy me, i've never heard flac before.
 

    On Thursday, February 7, 2019 7:10 PM, songbird <songbird@anthive.com> wrote:
 

 Long Wind wrote:
...
> i want to copy part of old mp3 file and create a new oneat first, i install lame, but it doesn't seem to have such abilityi try mencoder, it doesn't eitherthen i try qmp3cut, it says "no valid header found"though i can play the mp3 file and it's OK
> what should i do next? Thanks!

  not post in html...  :(


  that aside...

  does it have to be mp3 ?

  i convert all audios to flac before i do anything else
with them.

  pacpl will do conversions.

  once i have flac then i can edit with any audio editor
that does flac.  i like mhwaveedit.


  songbird



   

[toc] | [prev] | [next] | [standalone]


#205105

Fromsongbird <songbird@anthive.com>
Date2019-02-07 13:50 +0100
Message-ID<xoRhT-1nj-13@gated-at.bofh.it>
In reply to#205101
Long Wind wrote:
...
> Thank songbird, i think mp3 is popular and supported by many devices, and i=
> t satisfy me, i've never heard flac before.

  mhwaveedit also works on mp3's...  i just checked.  :)


  songbird

[toc] | [prev] | [next] | [standalone]


#205102

FromCurt <curty@free.fr>
Date2019-02-07 13:30 +0100
Message-ID<xoQYx-1gy-5@gated-at.bofh.it>
In reply to#205098
On 2019-02-07, songbird <songbird@anthive.com> wrote:
> Long Wind wrote:
> ...
>> i want to copy part of old mp3 file and create a new oneat first, i install lame, but it doesn't seem to have such abilityi try mencoder, it doesn't eitherthen i try qmp3cut, it says "no valid header found"though i can play the mp3 file and it's OK
>> what should i do next? Thanks!
>
>   not post in html...  :(
>
>
>   that aside...
>
>   does it have to be mp3 ?

It already is an old one.

>   i convert all audios to flac before i do anything else
> with them.
>
>   pacpl will do conversions.
>
>   once i have flac then i can edit with any audio editor
> that does flac.  i like mhwaveedit.

Another way to get from here to Rome:

'mpgtx'.

http://mpgtx.sourceforge.net/#Usage

[toc] | [prev] | [next] | [standalone]


#205104 — (solved)Re: how to select part of old mp3 and create new one

FromLong Wind <longwind2@yahoo.com>
Date2019-02-07 13:50 +0100
Subject(solved)Re: how to select part of old mp3 and create new one
Message-ID<xoRhT-1nj-3@gated-at.bofh.it>
In reply to#205102

[Multipart message — attachments visible in raw view] — view raw

Thank Curt! 
but i'm happy with ffmpeg and have little incentive to try other

the command to extract and create new mp3:
 ffmpeg -ss 5 -i input.mp3  -t 346 -acodec copy output.mp3

 

    On Thursday, February 7, 2019 8:26 PM, Curt <curty@free.fr> wrote:
 

 On 2019-02-07, songbird <songbird@anthive.com> wrote:
> Long Wind wrote:
> ...
>> i want to copy part of old mp3 file and create a new oneat first, i install lame, but it doesn't seem to have such abilityi try mencoder, it doesn't eitherthen i try qmp3cut, it says "no valid header found"though i can play the mp3 file and it's OK
>> what should i do next? Thanks!
>
>  not post in html...  :(
>
>
>  that aside...
>
>  does it have to be mp3 ?

It already is an old one.

>  i convert all audios to flac before i do anything else
> with them.
>
>  pacpl will do conversions.
>
>  once i have flac then i can edit with any audio editor
> that does flac.  i like mhwaveedit.

Another way to get from here to Rome:

'mpgtx'.

http://mpgtx.sourceforge.net/#Usage






   

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web