Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg failed to read header of audio file

    15 juillet 2016, par asad

    The file i am using (.m4a format) cant be read by ffmpeg. I can play this audio file in quicktime and vlc successfully. ffmpeg fails to read this particular file only. ffmpeg works with other .m4a files. Note:following works for this video too if i lower fps to 1 and resolution to 480p Following is the log:

    ffmpeg version N-80097-g89e9393 Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
      configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
      libavutil      55. 24.100 / 55. 24.100
      libavcodec     57. 43.100 / 57. 43.100
      libavformat    57. 37.100 / 57. 37.100
      libavdevice    57.  0.101 / 57.  0.101
      libavfilter     6. 46.100 /  6. 46.100
      libswscale      4.  1.100 /  4.  1.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, rawvideo, from 'pipe:0':
      Duration: N/A, start: 0.000000, bitrate: 314818 kb/s
        Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 854x480, 314818 kb/s, 24 tbr, 24 tbn
    Input #1, png_pipe, from '/home/ec2-user/logo-watermark-green_tpd.png':
      Duration: N/A, bitrate: N/A
        Stream #1:0: Video: png, rgba(pc), 287x185, 25 tbr, 25 tbn
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b71d00] error reading header
    /home/ec2-user/decryptedData/audios/Blrt_Decrypt_tfss-29882287-c1d5-4c54-b674-87e9de4a9e38-audio.m4a: Invalid data found when processing input
    "rjRoYZaDA1_854x480@24fps_1468547071.txt"
    

    Following is the code:

    /home/ec2-user/bin/ffmpeg \
    -framerate 24 -f rawvideo -pixel_format rgb32 -video_size 854x480 -i pipe:0 \
    -i /home/ec2-user/logo-watermark-green_tpd.png \
    -i /home/ec2-user/decryptedData/audios/Blrt_Decrypt_tfss-29882287-c1d5-4c54-b674-87e9de4a9e38-audio.m4a \
    -filter_complex "[0:v]vflip[main];[1:v]scale=854/10:-1[si], \
    [main][si]overlay=main_w-overlay_w:main_h-overlay_h:format=rgb,format=yuv420p" \
    -c:v libx264 \
    -c:a copy /home/ec2-user/videos/rjRoYZaDA1_854x480@24fps_1468563244030.mp4 \
    2> /home/ec2-user/logs/rjRoYZaDA1_854x480@24fps_1468563244.txt
    

    Please let me know what can possibly be done?

  • ffmpeg fails to read header of audio while creating video at 1080p@24fps

    15 juillet 2016, par asad

    I am trying to create video by merging rawvideo frames from opengl, .m4a audio file and .png image(logo). With videos of small duration (2-3 min) at 108p@24fps, following code works fine. But if the video is larger (10 min), code fails. FFmpeg gives following error log:

    ffmpeg version N-80097-g89e9393 Copyright (c) 2000-2016 the FFmpeg developers
      built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
      configuration: --prefix=/home/ec2-user/ffmpeg_build --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --bindir=/home/ec2-user/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265
      libavutil      55. 24.100 / 55. 24.100
      libavcodec     57. 43.100 / 57. 43.100
      libavformat    57. 37.100 / 57. 37.100
      libavdevice    57.  0.101 / 57.  0.101
      libavfilter     6. 46.100 /  6. 46.100
      libswscale      4.  1.100 /  4.  1.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, rawvideo, from 'pipe:0':
      Duration: N/A, start: 0.000000, bitrate: 314818 kb/s
        Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 854x480, 314818 kb/s, 24 tbr, 24 tbn
    Input #1, png_pipe, from '/home/ec2-user/logo-watermark-green_tpd.png':
      Duration: N/A, bitrate: N/A
        Stream #1:0: Video: png, rgba(pc), 287x185, 25 tbr, 25 tbn
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3b71d00] error reading header
    /home/ec2-user/decryptedData/audios/Blrt_Decrypt_tfss-29882287-c1d5-4c54-b674-87e9de4a9e38-audio.m4a: Invalid data found when processing input
    "rjRoYZaDA1_854x480@24fps_1468547071.txt"
    

    Code i am using is following:

    /home/ec2-user/bin/ffmpeg \
    -framerate 24 -f rawvideo -pixel_format rgb32 -video_size 854x480 -i pipe:0 \
    -i /home/ec2-user/logo-watermark-green_tpd.png \
    -i /home/ec2-user/decryptedData/audios/Blrt_Decrypt_tfss-29882287-c1d5-4c54-b674-87e9de4a9e38-audio.m4a \
    -filter_complex "[0:v]vflip[main];[1:v]scale=854/10:-1[si], \
    [main][si]overlay=main_w-overlay_w:main_h-overlay_h:format=rgb,format=yuv420p" \
    -c:v libx264 \
    -c:a copy /home/ec2-user/videos/rjRoYZaDA1_854x480@24fps_1468563244030.mp4 \
    2> /home/ec2-user/logs/rjRoYZaDA1_854x480@24fps_1468563244.txt
    

    Is it related to any memory?

  • VPS as video relay server using ffmpeg and ffserver ?

    15 juillet 2016, par Luke E

    I'm working on a project where I need to send a video stream from a laptop through a router I don't have control of to an Android phone on another network I don't have control of. The project also involves sending a stream of sensor data the opposite direction, for which I'm using a VPS and TCP hole punching quite successfully.

    So, I thought to myself, why not just stream the video from ffmpeg on my laptop to ffmpeg on the VPS, and then relay that via ffserver to my android phone? That's what I've been trying to do for a good while now, but haven't had much luck. The stream is recognized by the server but when putting it out over ffserver I get errors. Here is my ffserver.conf:

    HTTPPort 9000
    HTTPBindAddress 
    RTSPPort 5454
    RTSPBindAddress 
    
    
    File /tmp/feed1.ffm
    FileMaxSize 50M
    
    
    
    Feed feed1.ffm
    Format rtp
    VideoSize 960x540
    VideoBufferSize 0
    VideoFrameRate 30
    NoAudio
    AVOptionVideo flags +global_header
    
    

    And here's the command I'm using to take the received stream on the VPS and transmit it to ffserver:

    ./ffmpeg -protocol_whitelist file,udp,rtp -i foo.sdp  -an -c copy -f rtp rtsp://:5454/feed1.ffm
    

    When doing this command, I get the error "rtsp://:5454/feed1.ffm: Protocol not found"

    Any advice?

    I also thought about doing this with netcat and just and trying to forward all data received on the VPS at a certain port 1234 to any client connected to say port 1235, but this appears to be much more difficult than I thought.

    Thanks again for any help, and hopefully this problem is interesting to others as well.

  • What does "copy" do in a ffmpeg command line ?

    14 juillet 2016, par PsyberAlyen

    I know that it copies something but other than that what does it do (to what extend it affects the output file)? Is it a switch or option? Why does it not have a hyphen before the word itself?

    I see from other questions that it can copy streams without transcode but what are other possibility that I can manipulate it?

    I have done ffmpeg --help but I don't see any documentation about it. Is there a website I can read more about it?

  • Clojure shell/sh does not handle single-quoted arguments correctly ?

    14 juillet 2016, par Jarzka

    Executing the following command in the REPL:

    (shell/sh "ls" "-lah" "'resources'")
    

    gives the following output:

    {:exit 2, :out "", :err "ls: cannot access 'resources': No such file or directory\n"}
    

    Executing the same command in the Bash shell gives the correct output, the list of files in the resources directory. To my understanding this means that shell/sh is unable to handle single-quoted arguments correctly. Is this true or am I doing something wrong?

    The example above is a simple example, as usually I probably would not need to single-quote the folder name. But why this is a real problem is because I try to concat audio files by executing the following ffmpeg command using shell/sh;

    ffmpeg -i resources/ffmpeg_working/1.flac
    -i resources/ffmpeg_working/2.flac
    -i resources/ffmpeg_working/3.flac
    -i resources/ffmpeg_working/4.flac
    -filter_complex '[0:0][1:0][2:0][3:0]concat=n=4:v=0:a=1[out]'
    -map '[out]'
    resources/ffmpeg_working/done.flac
    

    This gives the following output

    Stream map ''[out]'' matches no streams.
    

    Once again, if I execute the same ffmpeg command in the Bash shell it concatenates the files successfully. Thus, it seems that the single-quoted argument is not handle correctly?