Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How can I make ffmpeg executable file separately by using gcc command ?

    8 juillet 2017, par koseonjae

    actually, my goal is to use ffmpeg on Qt platform. But tow of them is unfamiliar with me.. I tried command on ./ffmpeg directory after build (./configure, make, sudo make install) as below on Mac (os x) 10.12.4 (Sierra)

    $ gcc ffmpeg.c -o a.out -I /usr/local/include -I /Users/koseonjae/ffmpeg -L /usr/local/lib -lavdevice -lavutil -lavformat -lavcodec -lavutil -lx264 -lvpx -lvorbisenc -lvorbis -ltheoraenc -ltheoradec -logg -lmp3lame -lbz2 -lz -lxslt -lfdk-aac -liconv -lopus -lx265 -lxvidcore -lpng16 -lswresample -framework CoreFoundation -framework CoreServices -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework AVFoundation -framework CoreMedia -framework CoreVideo -framework CoreAudio -framework Foundation -framework Security -framework VideoDecodeAcceleration -framework VideoToolbox

    I added many library, but result is as below

    /Users/koseonjae/ffmpeg/ffmpeg2.h:157:8: error: unknown type name 'BOOL' static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType);

    /Users/koseonjae/ffmpeg/ffmpeg2.h:157:19: error: expected ';' after top level declarator static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType);


    what library should I add?? thank you!

  • Diagonal Split using ffmpeg

    8 juillet 2017, par Jeffin

    I am trying to acheive the following effect using ffmpeg

    enter image description here

    I have tried multiple options , but failed so far,

    I have referred the following questions , not happening for me

    I have three videos but i have somewhat acheived the diagonal split for two videos using the following code , but still couldnt get the output for three videos or four

    ffmpeg -i input0 -i input1 -filter_complex \
    "[1:v][0:v]blend=all_expr=if(gt(X\,Y*(W/H))\,A\,B)" output
    
  • Add text to image using AForge.Video.FFMEG in C#

    8 juillet 2017, par Ratzz

    Using AForge.Video.FFMPEG I am able to create video from Images.

            string[] files;
            string folderPath = @"FolderPath";
            files = Directory.GetFiles(folderPath).OrderBy(c => c).ToArray();
    
            VideoFileWriter writer = new VideoFileWriter();
            writer.Open(@"C:folder\new.mp4", imageWidth, imageHeight, 10, VideoCodec.MPEG4);
            for (int j = 0; j < files.Length; j++)
            {
                string fileName = files[j];
                BitmapSource imageBitMap = new BitmapImage(new Uri(fileName, UriKind.RelativeOrAbsolute));
                imageBitMap.Freeze();
                int stride = imageBitMap.PixelWidth * ((imageBitMap.Format.BitsPerPixel + 7) / 8);
                byte[] ImageInBits = new byte[imageBitMap.PixelWidth * imageBitMap.PixelHeight];
                imageBitMap.CopyPixels(ImageInBits, stride, 0);
    
                Bitmap image = new Bitmap(imageWidth, imageHeight, stride, PixelFormat.Format8bppIndexed, Marshal.UnsafeAddrOfPinnedArrayElement(ImageInBits, 0));
    
                writer.WriteVideoFrame(image);
                image.Dispose();
            }
    

    I am trying to add text/String to input image using

        private Bitmap WriteString(Bitmap bmp)
        {
            RectangleF rectf = new RectangleF(70, 90, 90, 50);
    
            Bitmap tempBitmap = new Bitmap(bmp.Width, bmp.Height);
            Graphics g = Graphics.FromImage(tempBitmap);
    
            g.DrawImage(bmp, 0, 0);
            g.SmoothingMode = SmoothingMode.AntiAlias;
            g.InterpolationMode = InterpolationMode.HighQualityBicubic;
            g.PixelOffsetMode = PixelOffsetMode.HighQuality;
            g.DrawString("yourText", new Font("Tahoma", 8), Brushes.Red, rectf);
            g.Flush();
    
            return bmp;
        }
    

    like

                Bitmap image = new Bitmap(imageWidth, imageHeight, stride, PixelFormat.Format8bppIndexed, Marshal.UnsafeAddrOfPinnedArrayElement(ImageInBits, 0));
                Bitmap outputBitmap=WriteString(image);
                writer.WriteVideoFrame(outputBitmap);
    

    How can I write a string to Image?

    Is there any way to add subtitle to AForge.Video.FFMEG to image before creating video?

  • extract NAL units bitstream from an MP4 video

    8 juillet 2017, par lighting

    Is it possible to extract every NAL units bitstream? (the actual bitstream)

    for example extract them like this:

    (4byte length + the remaining bytes till the end of the unit) and do this for all the units in a MP4 video? actually i want to check the occurrence of the 2 bytes after the 4byte length in a MP4 video (coded with H.264 codec). can i use FFmpeg for this?

    Thanks!

  • compress MP4 file using FFMPEG and PHP

    8 juillet 2017, par user2692997

    hello i am new to ffmpeg and am having trouble implementing it on my server i have managed to install it and found some code to confirm its working however i am trying to set the frame width and height but i am having no luck

    what i need help with - change frame width n height to something like 400 by 800 - any other changes you can recommend from experience for compressing mp4 for download - save and overwrite existing file

    this is the code i found to test ffmpeg

    extension_loaded('ffmpeg') or die('Error in loading ffmpeg');
    $vid = realpath('rc.mp4');
    $ffmpegInstance = new ffmpeg_movie($vid);
    echo "getDuration: " . $ffmpegInstance->getDuration() . "
    ". "getFrameHeight: " . $ffmpegInstance->getFrameHeight() . "
    ". "getFrameWidth: " . $ffmpegInstance->getFrameWidth() . "
    ". "hasAudio: " . $ffmpegInstance->hasAudio();

    enter image description here