相关疑难解决方法(0)

如何使用ffmpeg将mp3从x裁剪为x + n?

这个问题之后,我决定使用ffmpeg来裁剪MP3.在另一个问题上,我发现了这种做法:

ffmpeg -t 30 -acodec copy -i inputfile.mp3 outputfile.mp3
Run Code Online (Sandbox Code Playgroud)

问题是我不想裁剪前30秒,我想从x到x + n裁剪,比如30s到100s.我该怎么做呢?

我正在为ffmpeg读这个人,但这并不是很简单,特别是因为我刚刚发现了ffmpeg并且我不熟悉音频/视频编辑软件,所以任何指针都会受到赞赏.

mp3 ffmpeg crop

34
推荐指数
2
解决办法
2万
查看次数

FFMpeg 无需转码即可复制流

我正在尝试将多个文件中的所有流复制到一个文件中,而无需对流进行转码。你通常用ffmpeg效用做的事情ffmpeg -i “file_with_audio.mp4” -i “file_with_video.mp4” -c copy -shortest file_with_audio_and_video.mp4

这是代码:

int ffmpegOpenInputFile(const char* filename, AVFormatContext **ic) {

    int ret;
    unsigned int i;

    *ic = avformat_alloc_context();
    if (!(*ic))
        return -1; // Couldn't allocate input context

    if((ret = avformat_open_input(ic, filename, NULL, NULL)) < 0)
        return ret; // Couldn't open file

    // Get format info (retrieve stream information)
    if ((ret = avformat_find_stream_info(*ic, NULL)) < 0)
        return ret; // Couldn't find stream information

    for (int i = 0; i < (*ic)->nb_streams; …
Run Code Online (Sandbox Code Playgroud)

c ffmpeg libavcodec libavformat

3
推荐指数
1
解决办法
7269
查看次数

标签 统计

ffmpeg ×2

c ×1

crop ×1

libavcodec ×1

libavformat ×1

mp3 ×1