I am extracting a clip from an mpg video using the following command.
ffmpeg.exe -i 271b.mpg -ss 00:00:05.000 -t 00:00:03.200 -c copy out_271b.mpg
I am using the copy parameter to avoid reencoding the clip.
The resulting mpg file only has the audio track, no video.
The following is the FFMpeg screen dump.
C:\ffmpeg-20170615\bin>ffmpeg.exe -i 271b.mpg -ss 00:00:05.000 -t 00:00:03.200 -c copy out_271b.mpg
ffmpeg version N-86482-gbc40674 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 66.100 / 55. 66.100
libavcodec 57. 99.100 / 57. 99.100
libavformat 57. 73.100 / 57. 73.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 92.100 / 6. 92.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, mpeg, from '271b.mpg':
Duration: 00:01:11.44, start: 0.460000, bitrate: 2154 kb/s
Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bt470bg, progressive), 640x480 [SAR 1:1 DAR 4:3], 2000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
[mpeg # 0000000000666aa0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'out_271b.mpg':
Metadata:
encoder : Lavf57.73.100
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt470bg, progressive), 640x480 [SAR 1:1 DAR 4:3], q=2-31, 2000 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 74 fps=0.0 q=-1.0 Lsize= 786kB time=00:00:03.17 bitrate=2027.2kbits/s speed= 198x
video:730kB audio:50kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.843343%
Thanks
Addition: I tried to open the generated clip file with ffplay and got the following results. Note that ffplay was able to open and play the original mpg file.
ffplay.exe out_271b.mpg
ffplay version N-86482-gbc40674 Copyright (c) 2003-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 66.100 / 55. 66.100
libavcodec 57. 99.100 / 57. 99.100
libavformat 57. 73.100 / 57. 73.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 92.100 / 6. 92.100
libswscale 4. 7.101 / 4. 7.101
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
[mpeg # 00000000023cde80] probed stream 2 failedB sq= 0B f=0/0
[mpeg # 00000000023cde80] start time for stream 0 is not set in estimate_timings_from_pts
[mpeg # 00000000023cde80] Could not find codec parameters for stream 2 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpeg, from 'out_271bb.mpg':
Duration: 00:00:03.22, start: 0.500000, bitrate: 2068 kb/s
Stream #0:0[0x1bf]: Data: dvd_nav_packet 0KB sq= 0B f=0/0
Stream #0:1[0x1c0]: Audio: mp2, 44100 Hz, mono, s16p, 128 kb/s
Stream #0:2[0x1e0]: Video: none, none, 25 fps, 25 tbr, 90k tbn
SDL_OpenAudio (1 channels, 44100 Hz): DirectSoundCreate: No audio device found
No more combinations to try, audio open failed
No codec could be found with id 0
Failed to open file 'out_271b.mpg' or configure filtergraph
The command I used was :
C:\cmd\ffmpeg\bin\ffmpeg.exe -i "C:\Users\user\Dropbox\Workspace - C#\SnowflakeGenerator\out\out%d.png" -c:v libvpx -b:v 1M "C:\Users\user\Dropbox\Workspace - C#\SnowflakeGenerator\video.webm" -y
The output was:
ffmpeg version N-82889-g54931fd Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 68.100 / 57. 68.100
libavformat 57. 61.100 / 57. 61.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 68.100 / 6. 68.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, image2, from 'C:\Users\yb5243yv\Dropbox\Workspace - C#\SnowflakeGenerator\out\out%d.png':
Duration: 00:00:21.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 1000x1000 [SAR 3779:3779 DAR 1:1], 25 fps, 25 tbr, 25 tbn, 25 tbc
[libvpx # 0000000000be89c0] v1.6.0
[libvpx # 0000000000be89c0] Transparency encoding with auto_alt_ref does not work
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> vp8 (libvpx))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
The error is:
[libvpx # 0000000000be89c0] Transparency encoding with auto_alt_ref does not work
and
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
I'm not sure exactly what is causing the issue, I followed this tutorial, however they did not mention the error. I should mention that I am not using audio, so I left the audio encoder out (I did try it with the audio encoder to make sure, and that was not the problem)
Like the error msg says, Transparency encoding with auto_alt_ref does not work, so
ffmpeg.exe -i "out%d.png" -c:v libvpx -b:v 1M -auto-alt-ref 0 "video.webm" -y
Here is the error I am getting, I took a 7.1 AAC file, and remixed one of the tracks, and now I am trying to export back to the original format.
ffmpeg -i - -strict experimental -c:a aac -ac 8 -b:a 240k "F:\Something.aac"
ffmpeg version 2.2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on May 22 2014 19:56:44 with gcc 4.8.2 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-
libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Guessed Channel Layout for Input Stream #0.0 : 7.1
Input #0, wav, from 'pipe:':
Duration: N/A, bitrate: 5644 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 7.1, s16, 5644 kb/s
[aac # 02567320] Unsupported number of channels: 8
Output #0, adts, to 'F:\Something.aac':
Stream #0:0: Audio: aac, 44100 Hz, 7.1, fltp, 240 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le -> aac)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
Your ffmpeg is too old.
You can get a new build for Windows at Zeranoe. Users of other OSs can find links to builds at the FFmpeg Download page.
I have written cygwin based shell script to concate 2 .mkv files as below,
#!/bin/sh
ffmpeg -f concat -i concat.txt -codec copy out.mkv
concat.txt contains path to 2 mkv files to be concatenated
file '../temp/1'
file '../temp/2'
when I run script from cygwin terminal I get following error
Rishi#Rishikesh /cygdrive/i/video/Interface_code/Testing_function/bin
$ . script.sh
ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 30 2014 17:13:24 with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable- avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp -- enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.102 / 56. 15.102
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, concat, from 'concat.txt':
Duration: N/A, start: 0.000000, bitrate: 1536 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 720x576 [SAR 1:1 DAR 5:4], 25 fps, 25 tbr, 1k tbn, 50 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
'NULL # 04780280] Unable to find a suitable output format for 'out.mkv
: Invalid argument
another thing to add, if I run this command from cygwin terminal directly(instead of calling it through script) it runs correctly and creates concatenated output .mkv file
Applying dos2unix command on shell script file solved my problem. Hope it helps someone.
I have just downloaded the latest version of ffmpeg and I am trying to trim the first 14 and the last 6 seconds from a 40 seconds .mp3 file.
The problem I have is that doesn't matter what -t X I use, the output is always only 2 seconds in length. It's my first using ffmpeg but it seems like something is forcing it to limit the output to 2 seconds.
I tried a lot of commands including
ffmpeg -ss 00:00:14.358 -i input.mp3 -ab 32k -t 00:00:20.04 -c:a copy output.mp3 -y
ffmpeg -ss 14 -i input.mp3 -ab 32k -t 20 -c:a copy output.mp3 -y
ffmpeg -ss 14 -i input.mp3 -t 20 -acodec copy output.mp3 -y
ffmpeg -ss 14 -i input.mp3 -acodec copy output.mp3 -y
ffmpeg -ss 14 -t 20 -i input.mp3 output.mp3
ffmpeg -ss 14 -i input.mp3 -t 20 output.mp3
but the result is almost always a 2 sec mp3 file.
Now I'm out of ideas.
As requested this is the output from the console:
> Input #0, mp3, from 'C:\Track7.mp3': Duration: 00:00:40.49, start:
> 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 1kB time=00:00:00.00 bitrate= 752.3kbits/s video:0kB
> audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing
> overhead: 110.287079%
>
> C:\Je>ffmpeg -ss 00:00:14.358 -i "C:\Track7.mp3" -t 5 -c:a copy
> "C:\Track7.mp3" -y ffmpeg version N-75463-g53e8bef Copyright (c)
> 2000-2015 the FFmpeg developers built with gcc 4.9.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 [mp3 # 0000000002fb02c0] Skipping 0 bytes of junk at 0. [mp3 #
> 0000000002fb02c0] Estimating duration from bitrate, this may be
> inaccurate Input #0, mp3, from 'C:\Track7.mp3': Duration:
> 00:00:40.49, start: 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 32kB time=00:00:02.04 bitrate= 129.5kbits/s video:0kB
> audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing
> overhead: 1.410433%
>
> C:\Je>ffmpeg -ss 00:00:14.358 -i "C:\Track7.mp3" -c:a copy
> "C:\Track7.mp3" -t 5 -y ffmpeg version N-75463-g53e8bef Copyright (c)
> 2000-2015 the FFmpeg developers built with gcc 4.9.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 Trailing options were found on the commandline. [mp3 # 0000000003020300] Skipping 0
> bytes of junk at 0. [mp3 # 0000000003020300] Estimating duration from
> bitrate, this may be inaccurate Input #0, mp3, from 'C:\Track7.mp3':
> Duration: 00:00:40.49, start: 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 32kB time=00:00:02.04 bitrate= 129.5kbits/s video:0kB
> audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing
> overhead: 1.410433%
>
> C:\Je>ffmpeg -ss 00:00:14.358 -i "C:\Track7.mp3" -c:a copy -t 5
> "C:\Track7.mp3" -y ffmpeg version N-75463-g53e8bef Copyright (c)
> 2000-2015 the FFmpeg developers built with gcc 4.9.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 [mp3 # 00000000003102c0] Skipping 0 bytes of junk at 0. [mp3 #
> 00000000003102c0] Estimating duration from bitrate, this may be
> inaccurate Input #0, mp3, from 'C:\Track7.mp3': Duration:
> 00:00:40.49, start: 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 32kB time=00:00:02.04 bitrate= 129.5kbits/s video:0kB
> audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing
> overhead: 1.410433%
>
> C:\Je>ffmpeg -ss 00:00:14.358 -t 5 -i "C:\Track7.mp3" -c:a copy
> "C:\Track7.mp3" -y ffmpeg version N-75463-g53e8bef Copyright (c)
> 2000-2015 the FFmpeg developers built with gcc 4.9.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 [mp3 # 0000000002fb02c0] Skipping 0 bytes of junk at 0. [mp3 #
> 0000000002fb02c0] Estimating duration from bitrate, this may be
> inaccurate Input #0, mp3, from 'C:\Track7.mp3': Duration:
> 00:00:40.49, start: 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 32kB time=00:00:02.04 bitrate= 129.5kbits/s video:0kB
> audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing
> overhead: 1.410433%
>
> C:\Je>ffmpeg -i "C:\Track7.mp3"-ss 00:00:14.358 -acodec copy
> "C:\Track7.mp3" -y ffmpeg version N-75463-g53e8bef Copyright (c)
> 2000-2015 the FFmpeg developers built with gcc 4.9.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 C:\Track7.mp3-ss: No such file or directory
>
> C:\Je>ffmpeg -i "C:\Track7.mp3" -ss 00:00:14.358 -acodec copy
> "C:\Track7.mp3" -y ffmpeg version N-75463-g53e8bef Copyright (c)
> 2000-2015 the FFmpeg developers built with gcc 4.9.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 [mp3 # 0000000002fb0240] Skipping 0 bytes of junk at 0. [mp3 #
> 0000000002fb0240] Estimating duration from bitrate, this may be
> inaccurate Input #0, mp3, from 'C:\Track7.mp3': Duration:
> 00:00:40.49, start: 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 0kB time=00:00:00.00 bitrate=N/A video:0kB audio:0kB
> subtitle:0kB other streams:0kB global headers:0kB muxing overhead:
> unknown Output file is empty, nothing was encoded (check -ss / -t /
> -frames parameters if used)
>
> C:\Je>ffmpeg -ss 00:00:14.358 -i "C:\Track7.mp3" -c:a copy
> "C:\Track7.mp3" -y ffmpeg version N-75463-g53e8bef Copyright (c)
> 2000-2015 the FFmpeg developers built with gcc 4.9.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 [mp3 # 0000000002fb0220] Skipping 0 bytes of junk at 0. [mp3 #
> 0000000002fb0220] Estimating duration from bitrate, this may be
> inaccurate Input #0, mp3, from 'C:\Track7.mp3': Duration:
> 00:00:40.49, start: 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 32kB time=00:00:02.04 bitrate= 129.5kbits/s video:0kB
> audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing
> overhead: 1.410433%
>
> C:\Je>ffmpeg -ss 00:00:14.358 -i "C:\Track7.mp3" -ab 32k -c:a copy
> "C:\Track7.mp3" -y ffmpeg version N-75463-g53e8bef Copyright (c)
> 2000-2015 the FFmpeg developers built with gcc 4.9.3 (GCC)
> configuration: --enable-gpl --enable-version3 --disable-w32threads
> --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 [mp3 # 0000000002fb02c0] Skipping 0 bytes of junk at 0. [mp3 #
> 0000000002fb02c0] Estimating duration from bitrate, this may be
> inaccurate Input #0, mp3, from 'C:\Track7.mp3': Duration:
> 00:00:40.49, start: 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 32kB time=00:00:02.04 bitrate= 129.5kbits/s video:0kB
> audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing
> overhead: 1.410433%
>
> C:\Je>ffmpeg -ss 00:00:14.358 -i "C:\Track7.mp3" -ab 32k -t
> 00:00:20.04 -c:a copy "C:\Track7.mp3" -y ffmpeg version
> N-75463-g53e8bef Copyright (c) 2000-2015 the FFmpeg developers built
> with gcc 4.9.3 (GCC) configuration: --enable-gpl --enable-version3
> --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enab le-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable
> -libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena ble-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --e nable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib libavutil 55. 2.100 / 55. 2.100 libavcodec 57. 3.100 /
> 57. 3.100 libavformat 57. 2.100 / 57. 2.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 6.100 / 6. 6.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.100 /
> 2. 0.100 libpostproc 54. 0.100 / 54. 0.100 [mp3 # 00000000031903c0] Skipping 0 bytes of junk at 0. [mp3 #
> 00000000031903c0] Estimating duration from bitrate, this may be
> inaccurate Input #0, mp3, from 'C:\Track7.mp3': Duration:
> 00:00:40.49, start: 0.000000, bitrate: 128 kb/s
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s Output #0, mp3, to 'C:\Track7.mp3': Metadata:
> TSSE : Lavf57.2.100
> Stream #0:0: Audio: mp3, 44100 Hz, stereo, 128 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help
> size= 32kB time=00:00:02.04 bitrate= 129.5kbits/s video:0kB
> audio:32kB subtitle:0kB other streams:0kB global headers:0kB muxing
> overhead: 1.410433%
What am I doing wrong ?
The following work for me. Here is first 14 seconds:
ffmpeg -i input.mp3 -ab 32k -c:a copy -t 00:00:14 output.mp3 -y
Last 4 seconds (start from 6 seconds before end -> 40-6=34):
ffmpeg -ss 00:00:34 -i input.mp3 -ab 32k -c:a copy -t 00:00:06 output.mp3 -y