Crop MP3 to first 30 seconds

后端 未结 8 2095
南方客
南方客 2020-11-28 18:39

Original Question

I want to be able to generate a new (fully valid) MP3 file from an existing MP3 file to be used as a preview -- try-before-you-buy

相关标签:
8条回答
  • 2020-11-28 19:11

    My package medipack is a very simple command-line app as a wrapper over ffmpeg.

    you can achieve trimming your video using these commands:

    medipack trim input.mp3 -s 00:00 -e 00:30 -o output.mp3
    medipack trim input.mp3 -s 00:00 -t 00:30 -o output.mp3
    

    you can view options of trim subcommand as:

    srb@srb-pc:$ medipack trim -h
    usage: medipack trim [-h] [-s START] [-e END | -t TIME] [-o OUTPUT] [inp]
    
    positional arguments:
      inp                   input video file ex: input.mp4
    
    optional arguments:
      -h, --help            show this help message and exit
      -s START, --start START
                            start time for cuting in format hh:mm:ss or mm:ss
      -e END, --end END     end time for cuting in format hh:mm:ss or mm:ss
      -t TIME, --time TIME  clip duration in format hh:mm:ss or mm:ss
      -o OUTPUT, --output OUTPUT
    

    you could also explore other options using medipack -h

    srb@srb-pc:$ medipack --help
    usage: medipack.py [-h] [-v] {trim,crop,resize,extract} ...
    
    positional arguments:
      {trim,crop,resize,extract}
    
    optional arguments:
      -h, --help            show this help message and exit
      -v, --version         Display version number
    

    you may visit my repo https://github.com/srbcheema1/medipack and checkout examples in README.

    0 讨论(0)
  • 2020-11-28 19:16

    This command also works perfectly. I cropped my music files from 20 to 40 seconds.

    -y : force output file to overwrite.

    ffmpeg -i test.mp3 -ss 00:00:20 -to 00:00:40 -c copy -y temp.mp3
    
    0 讨论(0)
提交回复
热议问题