Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • Alexa developer console gives me "The audio is not of a supported MPEG version" Error

    20 mars, par Boban BoBo Banjevic

    I am trying to make an Alexa skill, and I am using audio mp3 files stored is S3, lambda function has access to my DynamoDb and ultimately S3. But I have an issue with my audio files. I keep on getting "The audio is not of a supported MPEG version" when I test alexa skill. I tried multiple ffmpeg -i file conversions.

    When I type ffprobe -v quiet -print_format json -show_format -show_streams "Piano.mf.A1.audio10.mp3" this is what i have for my file down below:

    
    Input #0, mp3, from 'Piano.mf.A1.audio10.mp3':
      Metadata:
        encoder         : Lavf61.9.107
      Duration: 00:00:07.00, start: 0.025057, bitrate: 129 kb/s
      Stream #0:0: Audio: mp3 (mp3float), 44100 Hz, stereo, fltp, 128 kb/s
        Metadata:
          encoder         : Lavc61.33
    PS C:\Users\boban\OneDrive\Desktop\newBob2> ffprobe -v quiet -print_format json -show_format -show_streams "Piano.mf.A1.audio10.mp3"
    {
        "streams": [
            {
                "index": 0,
                "codec_name": "mp3",
                "codec_long_name": "MP3 (MPEG audio layer 3)",
                "codec_type": "audio",
                "codec_tag_string": "[0][0][0][0]",
                "codec_tag": "0x0000",
                "sample_fmt": "fltp",
                "sample_rate": "44100",
                "channels": 2,
                "channel_layout": "stereo",
                "bits_per_sample": 0,
                "initial_padding": 0,
                "r_frame_rate": "0/0",
                "avg_frame_rate": "0/0",
                "time_base": "1/14112000",
                "start_pts": 353600,
                "start_time": "0.025057",
                "duration_ts": 98795520,
                "duration": "7.000816",
                "bit_rate": "128000",
                "disposition": {
                    "default": 0,
                    "dub": 0,
                    "original": 0,
                    "comment": 0,
                    "lyrics": 0,
                    "karaoke": 0,
                    "forced": 0,
                    "hearing_impaired": 0,
                    "visual_impaired": 0,
                    "clean_effects": 0,
                    "attached_pic": 0,
                    "timed_thumbnails": 0,
                    "non_diegetic": 0,
                    "captions": 0,
                    "descriptions": 0,
                    "metadata": 0,
                    "dependent": 0,
                    "still_image": 0,
                    "multilayer": 0
                },
                "tags": {
                    "encoder": "Lavc61.33"
                }
            }
        ],
        "format": {
            "filename": "Piano.mf.A1.audio10.mp3",
            "nb_streams": 1,
            "nb_programs": 0,
            "nb_stream_groups": 0,
            "format_name": "mp3",
            "format_long_name": "MP2/3 (MPEG audio layer 2/3)",
            "start_time": "0.025057",
            "duration": "7.000816",
            "size": "112892",
            "bit_rate": "129004",
            "probe_score": 51,
            "tags": {
                "encoder": "Lavf61.9.107"
            }
        }
    }
    

    It should be everything that is required, am I doing something wrong, this is the only thing stopping me from finishing the skill. Asking ChatGPT said it could be because of the mp3float, and after many conversions it still doesn't work.

  • laptop screen recorder built using python & ffmpeg can generate only video file in AVI format succesfully,generating corrupted MP4 file as output ? [closed]

    19 mars, par Rupashree Roy

    I have build laptop screen recorder with internal and external audio using python and ffmpeg,but it couldn't store output file in Other video formats,excepts AVI,if I try to store it in MP4 format,ut's showing file is corrupted,what to do/

    Here's the code, enter link description here

  • FFMPEG : preset not found in Windows Vista

    18 mars, par StackOverflowNewbie

    I download FFMPEG from http://www.videohelp.com/tools/ffmpeg#download and saved it in my c:\program files\ffmpeg (Windows Vista). My Path's first 2 entries are:

    c:\program files\ffmpeg\bin;c:\program files\ffmpeg\presets;
    

    I found the following command on the net (http://paulrouget.com/e/converttohtml5video/)

    ffmpeg -i input.avi -acodec libvorbis -ab 96k -vcodec libx264 -vpre main -level 21 -refs 2 -b 345k -bt 345k -threads 0 -s 320x240 output.mp4
    

    When I run this on command line, I get the following error:

    File for preset main not found

    Any ideas what might be wrong?

  • Is it possible to embed ffplay ?

    18 mars, par EthanL

    ffmpeg's viewer, ffplay, has a lot of great options for optimizing viewing experience. I've been able to get it to nicely display an RTSP stream at low latency. However, it's been difficult to include it in a GUI.

    Is that possible? Is there a GUI that does that?

    Note: I am NOT trying to embed in a browser, or just toss the window on top of a GUI.

    Best solution: desktop GUI that includes ffplay in a widget

    First alternative: desktop GUI that has variable opacity. If the ffplay window is layered below the GUI, and the GUI is transparent, it could look decent. However, some buttons would have to be visible, so the entire window can't be transparent.

    Second alternative: disable the possibility of user interaction with the ffplay window. Then, the ffplay window could just be tossed to the side of the screen, and it would remain there as a split screen, without concern that a user could minimize it or move it.

  • How to have a clean transition when concat MTS files using ffmpeg ?

    18 mars, par pho

    I have been struggling for a while and I hope someone can help me. What I want to do: 1- seek MTS files 2- conact them without re-encoding them

    How I do that: I write a file concatList.txt

    file 'file1.MTS'
    file 'file1_cut.MTS'
    

    I execute

    ffmpeg -y -i file1.MTS -ss 11.5 -c copy -copyts file1_cut.MTS
    ffmpeg -y -f concat -i concatList.txt -c copy output.MTS
    

    (11.5s corresponds to an I-frame)

    The transition between the two videos in output.MTS is very buggy during more than 1s

    To dig in, I tried to analyse the streams but it rises many questions:

    ffprobe -select_streams v -show_entries frame=pict_type,pts_time,pic_type,pts -skip_frame nokey -of compact -i file1.MTS
    
    pts;pts_time;pict_type
    147600;1.640000;I
    100800;1.120000;I
    1083600;12.040000;I
    1036800;11.520000;I ==> I cut the file here
    2019600;22.440000;I
    1972800;21.920000;I
    2955600;32.840000;I
    2908800;32.320000;I
    

    ==> Why not all I-frames are found by the -skip_frame nokey option ?

    ffmpeg -y -i file1_cut.MTS -map v:0 -c copy -copyts -f framemd5 file1_cut.md5
    

    combined with the following command output

    ffprobe -select_streams v -show_entries frame=pict_type,pts_time,pic_type,pts -of compact -i file1_cut.MTS
    
    stream;dts;diff_dts;pts;duration;size;hash;pts_time;pict_type
    0;163800;0;174600;1800;197323;7e228dfab2cb38922cab06844d67bf8c;1.94;I ==> This is the correct I-frame
    0;165600;1800;176400;1800;28860;80ef4505813b99bb4484c969f589fa35;;
    0;167400;1800;167400;1800;30289;d172722d01631a13caed81fc6be5b828;; ==> Why no frame type found by ffprobe ??
    0;169200;1800;169200;1800;23338;e22eb396408abbf66bd6ef4f8893d102;;
    0;171000;1800;171000;1800;24414;1a4f128017e8fc239b6c728f0c6d45b2;; ==> Why no frame type found by ffprobe ??
    0;172800;1800;172800;1800;28872;acd07b2f3ccbddd072c380bee709a2dc;;
    0;174600;1800;181800;1800;42872;eb225b253ebd427f2af01c2861d684c7;2.02;P
    0;176400;1800;183600;1800;35942;58a238b781b1bfe720aa6de61830e3b1;;
    0;178200;1800;178200;1800;22080;c6b43fbf1083d40499d908f0f02bd3dd;1.98;B
    0;180000;1800;180000;1800;24896;4481d088ad425da908daa83220111fd2;;
    0;181800;1800;189000;1800;40733;1294f59fe24d17aa8ca34fc327631d80;2.1;P
    0;183600;1800;190800;1800;37904;095f7be43c90e97d66fb8427a17cb4c3;;
    0;185400;1800;185400;1800;25808;a9d4e63c7607fcf9cd491084cce556ba;2.06;B
    0;187200;1800;187200;1800;24874;834117a8d7e106a2278c412ec0acd1df;;
    
    ffmpeg -y -i output.MTS -map v:0 -c copy -copyts -f framemd5 output.md5
    

    combined with the following command output

    ffprobe -select_streams v -show_entries frame=pict_type,pts_time,pic_type,pts -of compact -i output.MTS
    
    stream;dts;diff_dts;pts;duration;size;hash;pts_time;pict_type
    0;3106800;1800;3114000;1800;45853;7d5c2b6c9f4e1da8f93782b1de7de3a7;34.6;P;
    0;3108600;1800;3115800;1800;43213;b07554ad625850e3a4b8de54be6af1dd;;;
    0;3110400;1800;3110400;1800;25764;85c4aa6e62db831617a13bf5e6e08dda;34.56;B;
    0;3112200;1800;3112200;1800;24328;2e6bac4090917f2bc6ccedc8841612c5;;;
    0;3114000;1800;3121200;1800;46802;dfac0337af77c1a895e900048fc757c5;34.68;P; ==> Why pts larger than pts of first file1_cut.MTS frames ??
    0;3115800;1800;3123000;1800;41795;b33af7f2e6ca04c3179ef52c37df4fe5;;;
    0;3117600;1800;3117600;1800;23488;41a48cd53a2400d9331766ce3565c55c;34.64;B;
    0;3119400;1800;3119400;1800;23222;cc85ec074b62a0c51ac8e4e1196db079;;; ==> Last frame of file1.MTS
    0;3162240;42840;3173040;1800;197323;7e228dfab2cb38922cab06844d67bf8c;;; ==> First frame of file1_cut.MTS, ==> Why a lag of 42840 (0.4s) between two successive dts ??
    0;3164040;1800;3174840;1800;28860;80ef4505813b99bb4484c969f589fa35;;;
    0;3165840;1800;3165840;1800;30289;d172722d01631a13caed81fc6be5b828;;; ==> Why all these frames are not detected by ffprobe ??
    0;3167640;1800;3167640;1800;23338;e22eb396408abbf66bd6ef4f8893d102;;;
    0;3169440;1800;3169440;1800;24414;1a4f128017e8fc239b6c728f0c6d45b2;;;
    0;3171240;1800;3171240;1800;28872;acd07b2f3ccbddd072c380bee709a2dc;;;
    0;3173040;1800;3180240;1800;42872;eb225b253ebd427f2af01c2861d684c7;;;
    0;3174840;1800;3182040;1800;35942;58a238b781b1bfe720aa6de61830e3b1;;;
    0;3176640;1800;3176640;1800;22080;c6b43fbf1083d40499d908f0f02bd3dd;;;
    0;3178440;1800;3178440;1800;24896;4481d088ad425da908daa83220111fd2;;;
    0;3180240;1800;3187440;1800;40733;1294f59fe24d17aa8ca34fc327631d80;35.416;P;
    0;3182040;1800;3189240;1800;37904;095f7be43c90e97d66fb8427a17cb4c3;;;
    0;3183840;1800;3183840;1800;25808;a9d4e63c7607fcf9cd491084cce556ba;;; ==> Why ffprobe did not recognize the B-frame ??
    0;3185640;1800;3185640;1800;24874;834117a8d7e106a2278c412ec0acd1df;;;
    0;3187440;1800;3194640;1800;42645;13e6b4afb26734f0515303a5332dec32;35.496;P;
    0;3189240;1800;3196440;1800;39393;cfd5bdc15737562fc40ac4527057a034;;;
    0;3191040;1800;3191040;1800;25822;01b0d03c710f526c805c7aeaa54a39fb;35.456;B;
    0;3192840;1800;3192840;1800;25089;8306d0ab9a0cbaf16283b2019337973e;;;
    0;3194640;1800;3201840;1800;44593;1efb42bf015bbd71a54de2999ece272b;35.576;P;
    0;3196440;1800;3203640;1800;40391;e6ff5568c1b019250ecd9d3568a7e7b5;;;
    0;3198240;1800;3198240;1800;25354;c047b70a8a0725c4d60db8c92ea99706;35.536;B;
    

    So here is my main question: is there a "smart" concat command that cuts the frames of the first file that will never display (pts larger that the first frames of the second file), that anticipates the dts of I-frames of the second files, and that reduces the lag of dts to get a continuous stream?

    Thank you if anyone can answer.