Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Getting "unable to decode APP fields" while playing USB webcam stream through ffplay

    14 mai, par Syed

    I am trying to play USB Webcam stream(not sure in which format it is..) using ffplay in windows. I can see the video without any issue, But I am keep getting below error in console.

    ffplay.exe -f dshow -i video="Logitech HD Webcam C615" -loglevel debug

    [mjpeg @97a118cc80] unable to decode APP fields: Invalid data found when processing input check logs for more details

    Do I really need to worry about this error? Or any filter that I need to provide in command to get ride of this error .

    Note: I tried to save stream to a file using ffmpeg getting the same issue.

    Thanks in advance.

  • FPS reduction for H264

    14 mai, par Александр А

    There is a USB camera that sends H264 frames with a frequency of 30 fps in a resolution of 1920x1080, GOP size 30 or 60 (1 or 2 I frame per second depending on the camera), which requires throughput of about 6 mbit/s. It is necessary to reduce this to no more than 2 mbit/s. All this is done on a weak ARMv7, so the option of transcoding is extremely resource intensive, especially considering that I did not find how to do it as a GPU Mali (NanoPi Neo Core).

    Given that the basic functionality is performed on the framework ffmpeg, is it possible to reduce the frame rate, ideally to 10 fps, WITHOUT loss of quality and decoding?

  • How to batch process with ffmpeg script, but do each step in a loop instead of two stages

    14 mai, par Matt

    I'm a novice script editor. I convert MOV/AVI video files to MP4 format using a script with ffmpeg and then move the files after processing:

    for f in *.mov; do ffmpeg -y -i "$f" "${f%}.mp4"; done
    
    mv -f *.mov /Users/me/Videos/mov
    mv -f *.MOV /Users/me/Videos/mov
    mv -f *.avi /Users/me/Videos/avi
    mv -f *.AVI /Users/me/Videos/avi
    
    1. Currently the script converts all videos, then moves them all to the other folders. Please how can the script be adjusted so that each video is moved immediately after processing (instead of waiting until all are complete)? This would be a great improvement, as sometimes there are a lot of videos and the script gets interrupted for some reason (not a fault of the script). It will make it easier to monitor progress.

    2. Currently I manually tweak the first line changing *.mov for *.avi Please is there an easy way to handle either video file format/extension, within the same line?

    3. Is there a better way of handling the mv statements which have multiple lines for lower/uppercase? They also give error if there are no files of that type.

    Thank you

    The above script is functional but will be better with enhancements or changes.

  • Why every audio part is louder in FFmpeg when I join them in one audio ?

    14 mai, par Volodymyr Bilovus

    I trying to make dubbing for audio. I have original audio track and I want to put translated audio parts on top of the original.

    translated audio 100% vol: --p1--- ---p2-- -----p3--- --p4--

    original audio 5% vol: -----------------------------------------

    Here is my FFmpeg command with filter_complex

    ffmpeg -i video_wpmXlZF4XiE.opus -i 989-audio.mp3 -i 989-audio.mp3 -i 989-audio.mp3 -i 989-audio.mp3 \
    -filter_complex "\
    [0:a]loudnorm=I=-14:TP=-2:LRA=7, volume=0.05[original]; \
    [1:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=5000|5000, volume=1.0[sent1]; \
    [2:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=10000|10000, volume=1.0[sent2]; \
    [3:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=20000|20000, volume=1.0[sent3]; \
    [4:a]loudnorm=I=-14:TP=-2:LRA=7, adelay=30000|30000, volume=1.0[sent4]; \
    [original][sent1][sent2][sent3][sent4]amix=inputs=5:duration=longest[out]" \
    -map "[out]" output.mp3
    

    Audios I put on top of the original audio track is the same -i 989-audio.mp3 I made it by purpose to show the problem And here is the audio levels on final generated track. enter image description here

    As you can see, first and second only slightly different but third and fourth have totally different(higher) volume level (Notice, audio is the same). Why it's happened? And how can I workaround this odd behaviour?

  • ffmpeg problem video duration of an hour and a half

    14 mai, par Bruno Munné

    When start record i call an api /start-record which does:

    const ffmpeg = spawn("ffmpeg", [
            "-i",
            rtsp,
            "-c:v",
            "copy",
            "-an",
            "-f",
            "flv",
            `${filename}.flv`,
          ]);
    ffmpegProcesses[rtsp] = {
            process: ffmpeg,
            filename,
          };
    

    When stop the record i call an api /stop-record which does:

    ffmpegProcesses[rtsp].process.kill("SIGKILL");
    ffmpegProcesses[rtsp].process.on("exit", async () => {
       const ffmpeg = spawn("ffmpeg", [
              "-i",
              `${filename}.flv`,
              "-c:v",
              "libx264",
              "-preset",
              "fast",
              "-crf",
              "30",
              "-an",
              `${filename}.mp4`,
            ]);
    
        ffmpeg.on("exit", async () => {
            uploadToS3()
        })
    
    })
    

    If the recording is less than or equal to approximately 1 hour it works perfectly, but if the recording is 1 and a half hours it already breaks and it does not correctly generate the files, nor the flv nor the conversion to mp4

    I hope my program works the same way it does for 1 hour recordings