Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Decoding with QSV on ffmpeg [closed]

    21 janvier, par Grant Upson

    I'm having trouble trying to get decoding working using QSV with ffmpeg on Manjaro.

    After installing the dependencies I've run a few commands to verify it's installed correctly.

    The driver in use seems to be correct.

    echo $LIBVA_DRIVER_NAME
    
    iHD
    
    

    The decoders are available.

    ffmpeg -decoders | grep qsv
    
     V....D av1_qsv              AV1 video (Intel Quick Sync Video acceleration) (codec av1)
     V....D h264_qsv             H264 video (Intel Quick Sync Video acceleration) (codec h264)
     V....D hevc_qsv             HEVC video (Intel Quick Sync Video acceleration) (codec hevc)
     V....D mjpeg_qsv            MJPEG video (Intel Quick Sync Video acceleration) (codec mjpeg)
     V....D mpeg2_qsv            MPEG2VIDEO video (Intel Quick Sync Video acceleration) (codec mpeg2video)
     V....D vc1_qsv              VC1 video (Intel Quick Sync Video acceleration) (codec vc1)
     V....D vp8_qsv              VP8 video (Intel Quick Sync Video acceleration) (codec vp8)
     V....D vp9_qsv              VP9 video (Intel Quick Sync Video acceleration) (codec vp9)
     V....D vvc_qsv              VVC video (Intel Quick Sync Video acceleration) (codec vvc)
    

    and QSV seems to be available to ffmpeg on this device

    ffmpeg hwaccels
    
    Hardware acceleration methods:
    vdpau
    cuda
    vaapi
    qsv
    drm
    opencl
    vulkan
    

    yet when I try to decode a video I get spammed with this error:

    ffmpeg -hwaccel_output_format qsv -c:v h264_qsv -i fixed_output.mkv -f null -
    
    [vist#0:0/h264 @ 0x5b5e52273bc0] [dec:h264_qsv @ 0x5b5e521dea80] Error submitting packet to decoder: Unknown error occurred
    [h264_qsv @ 0x5b5e521df640] Error creating a MFX session: -9.
    [h264_qsv @ 0x5b5e521df640] Error initializing an MFX session
    [h264_qsv @ 0x5b5e521df640] Error decoding header
    

    Which led me to believe it may have been a device error, so I tried to init the device also when decoding like so:

    ffmpeg -init_hw_device qsv=qsv,child_device_type=dxva2 -hwaccel_output_format qsv -c:v h264_qsv -i fixed_output.mkv -f mp4 outputfile.mp4 -loglevel debug > qsv_log.txt 2>&1
    
    Applying option init_hw_device (initialise hardware device) with argument qsv=qsv,child_device_type=dxva2.
    [AVHWDeviceContext @ 0x60b977fcc940] No supported child device type is enabled
    Device creation failed: -38.
    Failed to set value 'qsv=qsv,child_device_type=dxva2' for option 'init_hw_device': Function not implemented
    Error parsing global options: Function not implemented
    

    And this seems to think there is no supported child device, but based on my understanding there is or the first few commands to verify it was linked and available wouldn't have worked? So i'm quite confused as to what a solution would be. Any advice?

  • Extract video clip from MP4 of exacting length [closed]

    21 janvier, par Wes

    The tools I've tried so far are only gives me approximations to the start and end times that I specify. They are usually off by a few seconds.

    I need a tool to extract video and audio at exact start and stop times, ideally to the millisecond. It would be preferable to do so without any easily noticeable loss in video quality from the original. I would also prefer to keep the audio in the video.

  • How to use the latest version of @ffmpeg/ffmpeg in a React.js project ?

    21 janvier, par Muzammil Raza

    I'm working on a React.js project where I need to process videos in the browser using @ffmpeg/ffmpeg. I noticed that the package has been updated recently, and the API and functions have changed.

    In the older version, I used to import the package and functions like this:

    import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';
    

    However, in the latest version, I see that the import has changed to:

    import { FFmpeg } from '@ffmpeg/ffmpeg';
    

    and all new functions are changed I have checked in by log:

    I have check by console ffmpeg, it show :

    createDir: path => {…}
    deleteDir: path => {…}
    deleteFile: path => {…}
    exec: ƒ ( /** ffmpeg command line args */ args)
    listDir: path => {…}
    load: ƒ ()
    loaded: true
    readFile: ƒ (path)
    rename: (oldPath, newPath) => {…}
    terminate: () => {…}
    writeFile: (path, data) => {…}
    

    I'm not sure about the changes in the API and functions, and I couldn't find any updated documentation or guides on how to use the latest version of @ffmpeg/ffmpeg in a React.js project.

    I have task of video processing for streaming and need to add logo in video.

    Could someone please provide guidance on how to use the latest version of @ffmpeg/ffmpeg in a React.js project? Specifically, I'm looking for information on the changes in the API, the new function names, and how to perform video processing tasks with the latest version.

    If anyone has experience with the latest version of @ffmpeg/ffmpeg or knows the updated usage, any help or examples would be greatly appreciated. Thank you!

  • ffmpeg - Record Server Desktop Without Connection

    21 janvier, par chrisp

    I set up an application which uses ffmpeg to record a desktop on an Amazon AWS EC2 instance having Windows Server 2012 R2 installed. It records the desktop and puts the result into a file.

    This works as long as a Remote Desktop or TeamViewer connection is active for that particular Amazon AWS EC2 instance. As soon as I close the Remote Desktop and TeamViewer connection the recording stops and continues as soon as I reconnect.

    I assume that it's because the GPU doesn't deliver frames without a display in use.

    How can I make sure that frames are constantly being rendered so that I can record them?

  • How to copy ffmpeg conversion output to file name without previous file extension [duplicate]

    20 janvier, par Tim

    I am trying to batch convert mp4 music files to m4a music files using ffmpeg on ubuntu .The command works but uses previous file extension for new name.

    find ./ -iname "*.mp4" type f -exec ffmpeg -i {} -vn -acodec cp "{}".m4a 
    

    This command produces a new file as such: ..01_Loser.mp4.m4a

    but I need ..01_Loser.m4a

    I cannot figure out how to get file name without previous extension. Any help would be appreciated. Thanks!