Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Video File Metadata information loss during file transfer

    5 avril 2019, par user2204553

    I am facing a problem during large file transfer from local drive to network mapped drive and problem is large video file meta data information like video duration,frame rate loss during file transfer.Please help to figure out.

  • Decode a single (H264) packet dumped by ffmpeg from a mp4 file

    5 avril 2019, par user1593842

    I used ffmpeg to dump a packet representing a single frame from an h264 video inside a mp4

    ffmpeg -i video.mp4 -c copy -vframes 1 -map 0:v:0 -f data frame.bin

    The data inside frame.bin seems to be fine and seems to be composed of exactly the same bytes as the first chunk/packet (I'm not sure what is the correct term) from the mdat atom.

    Now I want to decode that frame. Since I know the codec that was used to create that packet (h264), I thought I could simply prepare a codec context, load all that data into a packet and the use traditional avcodec_send_packet(codecContext, packet) followed by avcodec_receive_frame() combo.

    Unfortunately the call to avcodec_send_packetfails and I receive the following error

    (-1094995529) Invalid data found when processing input

    Since the first 4 bytes of the packet data is the size of the packet itself, I tried skipping those bytes before passing the buffer to the packet, but that also failed.

    Am I skipping some step or doing something wrong? Is what I am trying to do even possible? (please say yes :)

  • Why does my webm not work in Unity but others do ?

    5 avril 2019, par UserDude

    Ok Im just trying to play a transparent video in Unity and Im following http://mikebrinkerink.com/2018/04/05/preparing-a-video-with-alpha-channel-for-unity/ and other tutorials.

    Ive tried exporting as ProRes 444 with alpha and as Webm VP8, and using terminal ffmpeg commands. Yet when I drop the video into Unity it loads indefinitely and I have to force quit.

    My file is this: https://drive.google.com/file/d/1RhOvYfeaK1rEaKdlTNcJB9EBpz4xxjvw/view?usp=sharing

    And this one that I downloaded works fine: https://simpl.info/videoalpha/video/dancer1.webm

    Whats the difference/how can I get mine to work?

    Log:

    ffmpeg -i my_clip_with_alpha.avi -vcodec vp8 -acodec libvorbis -pix_fmt yuva420p -metadata:s:v:0 alpha_mode=”1″ -auto-alt-ref 0 my_vp8_clip_with_alpha.webm​
    

    as the command (with my clip's name)

    Then

    built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
      configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
      libavutil      56. 22.100 / 56. 22.100
      libavcodec     58. 35.100 / 58. 35.100
      libavformat    58. 20.100 / 58. 20.100
      libavdevice    58.  5.100 / 58.  5.100
      libavfilter     7. 40.101 /  7. 40.101
      libavresample   4.  0.  0 /  4.  0.  0
      libswscale      5.  3.100 /  5.  3.100
      libswresample   3.  3.100 /  3.  3.100
      libpostproc    55.  3.100 / 55.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/skylarthomas/Desktop/INSTRUCTIONS1_00000.mov':
      Metadata:
        major_brand     : qt  
        minor_version   : 537199360
        compatible_brands: qt  
        creation_time   : 2019-03-27T00:19:30.000000Z
      Duration: 00:00:17.05, start: 0.000000, bitrate: 40959 kb/s
        Stream #0:0(eng): Video: prores (ap4h / 0x68347061), yuva444p10le(tv, bt709, progressive), 2215x1773, 40467 kb/s, SAR 1:1 DAR 2215:1773, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default)
        Metadata:
          creation_time   : 2019-03-27T00:19:30.000000Z
          handler_name    : Apple Video Media Handler
          encoder         : Apple ProRes 4444
          timecode        : 00:00:00:00
        Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
        Metadata:
          creation_time   : 2019-03-27T00:19:30.000000Z
          handler_name    : Time Code Media Handler
          timecode        : 00:00:00:00
    Stream mapping:
      Stream #0:0 -> #0:0 (prores (native) -> vp8 (libvpx))
    Press [q] to stop, [?] for help
    [libvpx @ 0x7fe11701d600] v1.8.0
    Output #0, webm, to 'my_vp8_clip_with_alpha.webm':
      Metadata:
        major_brand     : qt  
        minor_version   : 537199360
        compatible_brands: qt  
        encoder         : Lavf58.20.100
        Stream #0:0(eng): Video: vp8 (libvpx), yuva420p, 2215x1773 [SAR 1:1 DAR 2215:1773], q=-1--1, 200 kb/s, 29.97 fps, 1k tbn, 29.97 tbc (default)
        Metadata:
          creation_time   : 2019-03-27T00:19:30.000000Z
          handler_name    : Apple Video Media Handler
          timecode        : 00:00:00:00
          alpha_mode      : ”1″
          encoder         : Lavc58.35.100 libvpx
        Side data:
          cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    frame=    2 fps=2.0 q=0.0 size=       1kB time=00:00:00.03 bitrate= 200.7kbits/sframe=    6 fps=3.7 q=0.0 size=       1kB time=00:00:00.16 bitrate=  40.6kbits/sframe=   10 fps=4.5 q=0.0 size=       1kB time=00:00:00.30 bitrate=  22.7kbits/s speedframe=   35 fps=2.9 q=0.0 size=       1kB time=00:00:01.13 bitrate=   6.0kbits/s speed=0.0934x    
    
  • Errors when use mps in NVDEC ?

    4 avril 2019, par johnsondeng

    I use ffmpeg compiled with cuda, support nvdec to decode h264 in gpu devices. MPS(https://docs.nvidia.com/deploy/mps/index.html) can share context with different processes, and this can use less gpu storage when use multi-process to decode h264 stream. But when I use ffmpeg in this mode, error got like this.

    Input #0, mpeg, from '/data/yt_traffic/media/nianjianbiao.mp4':
    Duration: 00:16:57.97, start: 7833.134000, bitrate: 4219 kb/s
    Stream #0:0[0x1e0]: Video: h264 (High), yuv420p(progressive), 1920x1080, 25 fps, 25 tbr, 90k tbn, 50 tbc
    File '1.yuv' already exists. Overwrite ? [y/N] y
    [AVHWDeviceContext @ 0x4444840] Could not initialize the CUDA driver API
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> rawvideo (native))
    Error while opening decoder for input stream #0:0 : Unknown error occurred
    

    But when mps is shutdown, ffmpeg works fine. Anyone can help?

  • How to automatically add date to output file generated in ffmpeg ?

    4 avril 2019, par Maxime Richard

    I am using Terminal to run ffmpeg commands (Mac OS) in order to record radio shows streamed online. The stream is in m3u8 I want to output it in mp3. So far so good, I am able to achieve that. However, I'd like the output file to read YYYYMMDD-fm93-segal.mp3 where YYYYMMMDD are the date the recording was made.

    I am not able to achieve this using -strftime 1 for some reason. When using my code, the output file reads %Y%m&d-fm93-segal.mp3 instead of replacing the strings by the real date.

    Here is the line I'm using:

    ffmpeg -i "https://cogecomedia.leanstream.co/cogecomedia/CJMFFM.stream/playlist.m3u8" -acodec mp3 -strftime 1 "%Y%m%d-fm93-segal.mp3" 
    

    Anyone knows why and could help me with that?