Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to save an audio (or video) feed to local using FFmpeg. Here are the command and arguments that I'm using.

ffmpeg -i http://7359.live.streamtheworld.com:80/CONTINENTALAAC_SC  -vn -ar 22050 -acodec flac -ss 0 -t 6000 test1.flac

I then iterate that in Bash, but I've got an overlap between the end of one file and the next.

Is there a way to get that feed chunked every 10 minutes?

This is t shell output:

    ffmpeg -i http://7359.live.streamtheworld.com:80/CONTINENTALAAC_SC  -vn -ar 22050 -acodec flac -ss 0 -t 6 test1.flac
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jan 29 2012 23:56:18 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libavfilter    1.19. 0 /  1.19. 0
  libswscale     0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
[aac @ 0x928e850]max_analyze_duration reached
[aac @ 0x928e850]Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from 'http://7359.live.streamtheworld.com:80/CONTINENTALAAC_SC':
  Duration: N/A, bitrate: 29 kb/s
    Stream #0.0: Audio: aac, 44100 Hz, 2 channels (FC), s16, 29 kb/s
File 'test1.flac' already exists. Overwrite ? [y/N] y
Output #0, flac, to 'test1.flac':
  Metadata:
    encoder         : Lavf52.64.2
    Stream #0.0: Audio: flac, 22050 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
size=     175kB time=6.06 bitrate= 236.6kbits/s
video:0kB audio:167kB global headers:0kB muxing overhead 4.824872%

Console print out with new arguments as suggested by LordNeckbeard:

ffmpeg -i http://7359.live.streamtheworld.com:80/CONTINENTALAAC_SC -vn -codec:a flac -map 0 -f segment -segment_list out.list -segment_time 00:10:00.00 out%03d.flac
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jan 29 2012 23:56:18 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
  configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables' --enable-avfilter --enable-avfilter-lavf --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libavfilter    1.19. 0 /  1.19. 0
  libswscale     0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
[aac @ 0x8c8e850]max_analyze_duration reached
[aac @ 0x8c8e850]Estimating duration from bitrate, this may be inaccurate
Input #0, aac, from 'http://7359.live.streamtheworld.com:80/CONTINENTALAAC_SC':
  Duration: N/A, bitrate: 23 kb/s
    Stream #0.0: Audio: aac, 44100 Hz, 2 channels (FC), s16, 23 kb/s
Unrecognized option 'codec:a'
share|improve this question
1  
What happens when you place the -ss before the -i? (Also, please always add full, uncut console output when asking FFmpeg questions, thanks) –  slhck Feb 5 '13 at 17:47
    
Works in the same way or at least with no noticiable difference –  xulen Feb 6 '13 at 19:14
add comment

1 Answer

up vote 1 down vote accepted

Try the segmenter muxer.

ffmpeg -i input -vn -codec:a flac -map 0 -f segment -segment_list out.list \
-segment_time 00:10:00.00 out%03d.flac

Copying the audio stream instead of re-encoding would be worth considering, but it is impossible to provide a non-guessing example without your ffmpeg console output.

share|improve this answer
    
Ffmpeg yells about I/O error occurred. Also ive tryed to apply those arguments with another input, a local file, and then it yells: ffmpeg: unrecognized option '-codec:a' –  xulen Feb 6 '13 at 13:40
    
@user144738 Your ffmpeg command and complete console output is missing. Please update your question with this information. –  LordNeckbeard Feb 6 '13 at 18:00
    
@user144738 Update your FFmpeg. Yours is now more than two years old. Download a static build from the homepage, for example. –  slhck Feb 6 '13 at 19:50
    
Thank you both, you make me happier. Works fine with newest static version (built feb 6 2013). The only thing that ive changed, because wasnt working for me, was the argument "-codec:a" to "-acodec". –  xulen Feb 7 '13 at 4:58
    
@xulen With a recent build, this should work. codec:a and c:a mean the same, and acodec is just an alias to the former. –  slhck Feb 7 '13 at 11:22
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.