ffmpeg segments only the first part of my audio file

亡梦爱人 提交于 2019-12-07 19:25:00

问题


I'm implementing a http live streaming server to send audio file to iOS devices. No problem with Apple's tools, mediafilesegmenter, my files are valid and it works fine.

I'm trying now to segment the same file using ffmpeg. I've downloaded the last stable version which is the 0.10.2 for now.

Here is how I try to segment my mp3 file:

./ffmpeg -re -i input.mp3 -f segment -segment_time 10 -segment_list outputList.m3u8 -acodec libmp3lame -map 0 output%03d.mp3

It starts the mapping like expected but finish with only one .mp3 file.

Did I miss something in the process? Thanks in advance.

edit

Ok here is my latest command line:

ffmpeg -i input.mp3 -c:a libmp3lame -b:a 128k -map 0:0 -f segment -segment_time 10 -segment_list outputlist.m3u8 -segment_format mp3 'output%03d.mp3'

It still gives me only one file but the file is the hole song, not only one part. Here is the output of ffmpeg:

ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers 
built on Apr 20 2012 07:08:29 with gcc 4.5.2   
configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libmp3lame   
    libavutil      51. 35.100 / 51. 35.100   
    libavcodec     53. 61.100 / 53. 61.100   
    libavformat    53. 32.100 /
        53. 32.100   
    libavdevice    53.  4.100 / 53.  4.100   
    libavfilter     2. 61.100 /  2. 61.100   
    libswscale      2.  1.100 /  2.  1.100   
    libswresample   0.  6.100 /  0.  6.100   
    libpostproc    52.  0.100 /  52.  0.100 
    [mp3 @ 0x8e4f120] max_analyze_duration 5000000 reached at 5015510
Input #0, mp3, from 'BeachHouse-Myth.mp3':   
    Metadata:
            title           : Myth
            artist          : Beach House
            track           : /
            album           : Bloom
            disc            : /
            genre           : Alternative
            TSRC            : USSUB1296501   
    Duration: 00:04:18.69, start: 0.000000, bitrate: 320 kb/s
            Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 320 kb/s Output #0, segment, to 'stream%03d.mp3':   Metadata:
            title           : Myth
            artist          : Beach House
            track           : /
            album           : Bloom
            disc            : /
            genre           : Alternative
            TSRC            : USSUB1296501
            encoder         : Lavf53.32.100
            Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:   
    Stream #0:0 -> #0:0 (mp3 -> libmp3lame) 
    Press [q] to stop, [?] for help 
    Truncating packet of size 1024 to 105ate=   0.0kbits/s    
    Truncating packet of size 1024 to 1 
    size=       0kB time=00:04:18.71 bitrate=   0.0kbits/s     video:0kB audio:4042kB global headers:0kB muxing overhead -100.000000%

回答1:


Audio only might be a bug. I contacted the FFMPEG player bug list, and a bug is filed: http://ffmpeg.org/trac/ffmpeg/ticket/1290



来源:https://stackoverflow.com/questions/10241070/ffmpeg-segments-only-the-first-part-of-my-audio-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!