SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Convert videos to FLV.

    I have a dedicated server with Debian where I can install everything I want.

    I would really like to try to create a "simple" upload script for videos, which first upload the video to a certain folder (this I CAN do already) and thereafter the server converts the video to FLV with a maximum height or width.

    I have read a lot about using ffmpeg and flvtools2 etc. but not sure on how to do it. And it should be able for an user to upload the next video as soon as he or her is finished uploading the first one.

    Any tutorials, example etc...? It should be able to almost convert any video and it could be cool if it somehow could check if it was possible before starting, so the user could get an error if it failed... But it's not the main part, that is "just" the convert script etc...

  2. #2
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since you are on debian, I did a google search on "linux flv encoder" this looks like it may work for you ... it is a php flv encoder for linux

    http://www.sothinkmedia.com/flash-video-encoder-linux/
    intragenesis, llc professional web & graphic design

  3. #3
    SitePoint Addict
    Join Date
    Jul 2002
    Location
    Sooner Nation
    Posts
    208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've done this a few times but had a server admin set up ffmpeg.

    Basically upload the file to a dir. If its a low usage site you could choose to encode it right away. Insert the file path name ect in the dadtabase. Or you could choose to upload it to a directory and insert the file name into the database with a flag of processed = 0 then run a cron to pull all unprocessed videos and process then and update the database with the new file name and delete the uncoverted file.
    The only function of business is to create customer value and to innovate. - Peter Drucker

  4. #4
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you think ffmpeg can convert all my video needs (videos recorded from cell-phones etc.)?

    And where does mencoder come in the picture?

    And finally, is there a universal call (command) for ffmpeg converting my videos width a maximum height and width etc.? (I've never used ffmpeg).

  5. #5
    SitePoint Addict
    Join Date
    Jul 2002
    Location
    Sooner Nation
    Posts
    208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure about cell but I've tested several other file types
    Here is the sys command that I use to execute the conversion

    PHP Code:
    $cmd "mencoder $input_filepath -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -vf scale=450:400 -srate 22050 -o $output_filepath";

    system($cmd
    But what you are wanting can be accomplished. i just don't have a link to any tutorials and my code is pretty jacked up...
    The only function of business is to create customer value and to innovate. - Peter Drucker

  6. #6
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mencoder uses ffmpeg libraries, but it adds features of its own. However, ffmpeg does its thing its own way, and they are still completely separate products.

  7. #7
    SitePoint Zealot steven012's Avatar
    Join Date
    Dec 2005
    Location
    xi an city,ShanXi Province,China
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by soonerdm View Post
    Not sure about cell but I've tested several other file types
    Here is the sys command that I use to execute the conversion

    PHP Code:
    $cmd "mencoder $input_filepath -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -vf scale=450:400 -srate 22050 -o $output_filepath";

    system($cmd
    But what you are wanting can be accomplished. i just don't have a link to any tutorials and my code is pretty jacked up...
    Hi,I input
    Code:
    mencoder 2.rmvb -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=5000:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -vf scale=450:400 -srate 22050 -o
    and I get the following errors:
    "sse supported but disabled
    sse2 supported but disabled
    option oac:unknown suboption mpelame
    error parsing option on the command line :-oac"
    the 2.rmvb and the mencoder.exe is in the same path.What's wrong?Anyone can help me?thanks!
    One world,One dream

  8. #8
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can do it in railo cfml engine for free


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •