Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Error LIBSWRESAMPLE_0 Compiling ffmpeg Kubuntu 12.04

    30 septembre 2013, par lobo115

    i try to compile ffmpeg in ubuntu 12.04 with this tuto But i had a error with a library so i use this to solve it:

    sudo apt-get update
    sudo apt-get -y install build-essential checkinstall git libfaac-dev libgpac-dev \
      libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev \
      libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev \
      libxfixes-dev texi2html yasm zlib1g-dev
    

    and this

    cd
    git clone git://git.videolan.org/x264
    cd x264
    ./configure --enable-static
    make
    sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
      awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
      --fstrans=no --default
    

    then i have a problem with another library so i use a apt-get install to add libgsm1-dev, then i could install it, but now when i tried to execute it said:

    ffmpeg: relocation error: /usr/local/lib/libavfilter.so.3: symbol swr_get_class, version LIBSWRESAMPLE_0 not defined in file libswresample.so.0 with link time reference
    

    So i look for help, and tried

    export LD_LIBRARY_PATH=/usr/local/lib
    sudo ldconfig -v
    

    but it didn't work, could you help me? Thz

    PS:When i tried to install WINFF with synaptic or apt-get it said that it will install ffmpeg.

  • How to add watermark when converting to more than one video with -s option ?

    30 septembre 2013, par user2783132

    I have a problem adding watermark to my video. I'm converting a video into 5 different resolutions using the -s option.

    what I've tried:

    waterMark="\"movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]\""
    
    resolutions=$(echo -e "${resolutions} -s ${newX}x${myY} ${map} -vcodec libx264 ${options} 
    -vf ${waterMark} ${NEW_FILENAME}_${myY}p.mp4")
    
    ffmpeg -i $FILENAME "${resolutions}"
    

    here's the echo of the command: echo "ffmpeg -i $FILENAME $resolutions"

    ffmpeg -i test.mp4  
     -s 1728x720 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_720p.mp4 
     -s 1152x480 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_480p.mp4 
     -s 864x360 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_360p.mp4 
     -s 576x240 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_240p.mp4 
     -s 344x144 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_144p.mp4
    

    I don't know what the error is, all i'm getting is part of the code in red:

    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 126 kb/s
    Metadata:
      handler_name    : SoundHandler  
    

    this part in red*

    -s 1728x720 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_720p.mp4 -s 1152x480 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_480p.mp4 -s 864x360 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_360p.mp4 -s 576x240 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" test_240p.mp4 -s 344x144 -map 0:0 -map 0:1 -vcodec libx264 -acodec aac -strict experimental -movflags faststart -vf "movie=/watermark.png [watermark]; [in

    I also tried adding the watermark right after -i $FILENAME

    ffmpeg -i $FILENAME -vf "movie=/watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" $resolutions"
    

    but in that case only the first video comes out with a watermark.

  • Save and re-stream RSTP video as straight UDP

    30 septembre 2013, par user1701362

    I am trying to write a program that will connect to a RTSP video source and redirect the video data to another location using UDP. I am also saving the RTSP packets to be able to replay the video stream at a latter moment in time as well. Right now my program can connect to the RTSP video stream and redirect and save, but when I try to look at the redirected video I get nothing using VLC.

    Currently the program just strips out the datagram from the RTSP video packets it receives in its open UDP socket and re-sends them using this code using the boost asio library.

    newVideoSocket->send_to(&dg.data[0], dg.data.size() ,Endpoint);
    

    When I look at the traffic using Wireshark I see that it is actually sending the data to the new address and it is recognized as a UDP packet, but when I try and view the video using VLC nothing happens. The video stream is Mpeg4 with the video encoded as H.264 and VLC can play it.

    I have tried to connect to the redirected stream as UDP and as RTP at both multicast and unicast addresses but have had no success. Do I need to add or take something out of the datagram before I resend it? Or is it something wrong with how I am tring to view it in VLC? Thanks for the help.

  • A few questions about running a video gallery site

    30 septembre 2013, par Kevin Kevinz

    my site is going to be hosting a lot of videos. I'm using FFMPEG for all video functions. My current video upload plan is as follows :

    -get input video -make video thumbnail -if its mp4/flv, convert it to ogv (for opera support) -if its not mp4/flv, convert it to mp4 and also convert the original to ogv

    (the file conversions are running in the background)

    I'm using jwPlayer 6 for all videos currently. What can I do to maximize cross-browser and cross-platform support? iOS won't run flv because it can't run flash, so is it worth it to just convert every file to MP4? And what about HTML5 video? Should I consider HTML5 as my primary player and jwPlayer my fallback?

    Thanks everyone.

  • How to hide/disable ffmpeg erros when using OpenCV (python) ?

    29 septembre 2013, par Mehran

    I'm using OpenCV python to capture a video. This is my code

    import cv2
    
    cap = cv2.VideoCapture("vid.mp4")
    while True:
        flag, frame =  cap.read()
    
        if not flag:
            cv2.imshow('video', frame)
    
        if cv2.waitKey(10) == 27:
            break
    

    When a frame is not ready it produces an error like this

    enter image description here

    or

    Truncating packet of size 2916 to 1536
    [h264 @ 0x7ffa4180be00] AVC: nal size 2912
    [h264 @ 0x7ffa4180be00] AVC: nal size 2912
    [h264 @ 0x7ffa4180be00] no frame!
    
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7ffa41803000] stream 0, offset 0x14565: partial file
    

    I wanted to find a way to hide this error! I guess that this error is being produced by ffmpeg. Is there any way to hide or disable it?

    This error is produced when I call cap.read(). And I also tried to wrap it with try ... except ... but it doesn't work because it doesn't throw any exceptions.