Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • linking MSVC .lib using MinGW64

    27 mai 2014, par govind

    I want to create a plugin for ffmpeg. I have compiled my plugin using MSVC 64-bit compiler (cl.exe) and i have the plugin.lib Now while building ffmpeg using Mingw64 the linker is not able to find any functions which are defined in plugin.lib. I have confirmed using nm.exe that the functions are definitely present in my plugin.lib.

    I have followed all the steps required for plugin-ffmpeg integration which i am sure are not causing this because on Linux, ffmpeg (built using gcc) is able to integrate with plugin (built using Intel-compiler).

    I was reading here that it is possible to link a 64bit MSVC created dynamic library(.dll) with MinGW but not a static library(.lib).

    Also this page says that it is possible to link using reimp and dlltool. But for that i need a .lib and a .dll both. Also it does not specify 32 or 64 bit.

    So my doubts:

    Is it possible to link a 32bit MSVC .lib with MinGW(32)?

    Is it possible to link a 64bit MSVC .lib with MinGW64? And if yes then how?

    Building both ffmpeg and plugin using the same compiler might work but that's not an option for me. Also i am using C only.

  • How to rotate thumbnail image in ffmpeg

    27 mai 2014, par Vishal Sharma

    I am using this code for my thumbnail image

    <?php 
    $ffmpeg = '/usr/bin/ffmpeg'; 
    $second = 2;
    $video = 'video/123.mp4';    
    $image = 'thumb/123.jpg';
    $command = "$ffmpeg  -itsoffset -$second  -i $video -vcodec mjpeg -vframes 1 -an -f rawvideo -s 175x150 $image"; 
    

    its giving me the thumbnail image BUT i want to rotate that thumbnail image. I already tried transpose and rotate but nothing happen even i lost the thumbnail image also.

    Tried solutions but nothing happen :-

    $command ="$ffmpeg -itsoffset -$second -i $video -vcodec mjpeg -vframes 1 -vf 'transpose=1' -an -f rawvideo -s 175x150 $image"; 
    

    and

    $command ="$ffmpeg -itsoffset -$second -i $video -vcodec mjpeg -vframes 1 -vf 'rotate=PI/2' -an -f rawvideo -s 175x150 $image";
    

    Please help me.....

  • What is the best jpeg encoder/decoder ? [on hold]

    27 mai 2014, par user3678446

    So I made a server and I was playing with data transfer. And i wanted to make a program like TeamViewer(just for fun not planning to achieve teamViewer performance). And I was sending png screenshots. After a few tests I realized that png encoding takes way too long. So i decided to change all that part to jpeg. And I would want to know what is the best library to use. I heard in some other question that libavcodec in the ffmpeg project is really good. It seems pretty complicated especially cause I don't have a source of learning it and I will try to learn it no my own. And I don't want to put that much effort(if it's that much effort) to learn it when i could learn the best one.

    So the question is what is the best library for jpeg encoding and decoding. Or maybe if it's there something better for something like teamviewer let me know.

  • How can I programatically escape option strings for ffmpeg ?

    27 mai 2014, par pixelearth

    I'm just using ffmpeg for my first serious project. I was happy until I had a string that needed escaping. Now I want to die.

    I want to put this string into a blank video that will then (later) be appended to a separate video "Tango Milonga 1: The Dance's Music and History"

    When I write it like this, it obviously doesn't work becaues the : and ' chars need escaping and probably others:

    ffmpeg -y -f lavfi -i color=c=black:s=640x362 -t 4 -vf drawtext="fontfile=/Library/Fonts/Arial.ttf: text=Tango Milonga 1: The Dance's Music and History: fontcolor=white: fontsize=24: box=0: x=(w-text_w)/2: y=(h-text_h-line_h)/2","fade=t=out:st=3:d=1"            /Users/user/my_life/sites/2007/idance/videos_in_production/intros/2621.mp4
    

    To make matters more complicated, command and the text option in this example will really be dynamically generated from a DB and will be looped over thousands of times. This currently looks like this in my ruby script (another level of escaping):

      `ffmpeg -y -f lavfi -i color=c=black:s=640x362 -t 4 -vf drawtext="fontfile=/Library/Fonts/Arial.ttf: text=#{@lesson.name}: fontcolor=white: fontsize=24: box=0: x=(w-text_w)/2: y=(h-text_h-line_h)/2","fade=t=out:st=3:d=1" #{@dir}/intros/#{@lesson.id}.mp4`
    

    How can I programatically escape the string @lesson.name above so that this command always works?

  • ffmpeg video to image sequence batch file

    26 mai 2014, par Dale Cooper

    I'm using ffmpeg to convert .avi file into a .png image sequence. This one works just fine:

    @ ECHO OFF
    
    FOR %%A IN (*.avi) DO CALL :avi2png "%%A"
    
    :avi2png
    ffmpeg.exe -y -i %* -sameq -f image2 -c:v png "%%03d.png"
    
    ECHO.
    GOTO :EOF
    

    But I want the script to extract the name without the extension from .avi file that is currently being processed. This is what the image sequence should look like: currentavi001.png, currentavi002.png etc. The script I came up with isn't working:

    @ ECHO OFF
    
    FOR %%A IN (*.avi) DO CALL :avi2png "%%A"
    
    :avi2png
    ffmpeg.exe -y -i %* -sameq -f image2 -c:v png "%%~nA%%03d.png"
    
    ECHO.
    GOTO :EOF
    

    I've tried both %~nA and %%~nA, but to no avail. The script returns this:

    Couldn't open file : 
    av_interleaved_write_frame(): Input/output error.
    

    I'm a complete layman and would welcome every bit of help.