php ffmpeg

Discussion in 'PHP' started by dramiditis, Oct 17, 2010.

  1. #1
    Hi,
    I'm trying to create video from folder with images with ffmpeg:

    
         exec("ffmpeg -r 10 -b 1800 -i Image%03d.jpg test1800.mp4");
    
    
    
    PHP:
    but nothing happends. Any idea why or any other command?
     
    dramiditis, Oct 17, 2010 IP
  2. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Checklist:
    - You have ffmpeg installed
    - Image file is located in same folder as your php script

    Are you running this on cgi or cli?
     
    imperialDirectory, Oct 18, 2010 IP
  3. dramiditis

    dramiditis Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ok, everything is ok, I had a problem with images. Thanks. If you are good with ffmpeg have one question. If I have two images in my folder, how can I make video lenght about 50 sec, witch first image will be 10 sec and second 40 sec. ?
     
    dramiditis, Oct 18, 2010 IP
  4. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Assuming your frame rate is 29.97. You can try
    
    ffmpeg -y -i VIDEO_NAME -ss 10 -vframes 1 -an -f mjpeg -sameq IMAGE_NAME
    ffmpeg -y -i VIDEO_NAME -ss 40 -vframes 1 -an -f mjpeg -sameq IMAGE_NAME
    
    Code (markup):
     
    imperialDirectory, Oct 18, 2010 IP
  5. dramiditis

    dramiditis Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Maybe I don't doing something write. I did:
    But I got videoimage000000.jpg to videoimage000022.jpg

    I don't know I would like to put two images in one folder and to make video from this two images, which first will be first 10 sec of video and second image next 40 sec. of same video.
    Thanks
     
    dramiditis, Oct 18, 2010 IP
  6. scriptinstaller

    scriptinstaller Peon

    Messages:
    109
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    exec("/usr/bin/ffmpeg -y -i $flvfile -pix_fmt rgb24 -vframes 1 -ss 00:00:10 -an -vcodec mjpeg -f rawvideo -s 128x110 $thumb");
    exec("/usr/bin/ffmpeg -y -i $flvfile -pix_fmt rgb24 -vframes 1 -ss 00:00:40 -an -vcodec mjpeg -f rawvideo -s 128x110 $thumb");

    replace 00:00:08 with a $var or a different time than needed, obviously that is at 10 seconds
    $thumb being the filename of the thumb to create $flvfile being the path to the flv file

    I guess you're close just have a time format that not working? or perhaps you might be using a file that is using/encoded with DRM, which in case you can't get thumbs from it... check that
     
    scriptinstaller, Oct 23, 2010 IP