using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subtitle

Discussion in 'Off Topic' started by psrnet00, Jun 21, 2011.

  1. psrnet00

    psrnet00 New Member

    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    {sorry for bad english knowledge}

    i need to online convert video from url or direct downloadable site so i can download files after conversion

    i know some website provide online conversion of video and other files length is near 200 mb, but i need to convert more than 700MB

    i am very new to PHP, my question is that

    is there any way to create this php script or if you know how to do php script than help me to create this script

    or if this script is available than from where i can download this script for free with tutorial

    plzzzz do reply
     
  2. essellar

    essellar Community Advocate Community Support

    Messages:
    3,295
    Likes Received:
    227
    Trophy Points:
    63
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    I'm going to try to strongly discourage you from trying this at all. Video conversion (decoding, then encoding) requires a lot of processing cycles and a large memory space, and getting conversion speeds significantly faster than real-time (one second of video takes one second to convert) takes a lot of horsepower. It's not even close to practical in a shared environment -- even if the timesharing and memory management were perfect and never allowed your code more than its share of resources, the processing time would increase to the point that burning a disc and hand-delivering it would be a practical alternative.

    Even the typical VPS would be underpowered for the task, and it's not something where you can just spawn a new instance to share the load (as you can with a request/reponse web server). That means a dedicated or co-located server with above-average specs. And that means money with a capital M. And you still won't be able to do it fast enough for a browser to wait for the results.

    It's far more practical to do the conversion on your local machine/network without the PHP layer, even if the object of the game is to move the files to a web server for download.
     
  3. callumacrae

    callumacrae not alex mac Community Support

    Messages:
    5,257
    Likes Received:
    97
    Trophy Points:
    48
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    And you DEFINITELY wouldn't want to do this in PHP.
     
  4. psrnet00

    psrnet00 New Member

    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    ok... thanks anyway


    i want to change design of php but i can't find it... (x10hosting)
     
  5. GtoXic

    GtoXic x10 Support

    Messages:
    636
    Likes Received:
    17
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    by change the design do you mean the style of the page (eg: colours etc)?

    If so, use CSS. You can find CSS help from google.
    Thanks for reading, GtoXic
     
  6. Murphy65

    Murphy65 New Member

    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    search in wp site in plugun sections!
     
  7. SierraAR

    SierraAR Community Advocate Community Support

    Messages:
    827
    Likes Received:
    17
    Trophy Points:
    18
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    You would probably have better results using an actual program designed for converting video formats, instead of doing it via an online application anyway.
     
  8. saviorfromthenorth

    saviorfromthenorth New Member

    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    I have the used ffmpeg extension before, it does work. It's not preloaded so you would have to install it yourself. The major problem you will be facing though are the numerous codecs out there that the library does not know how to convert. So you will experience a lot of errors. That's why nobody encourages you to try it.
     
  9. psrnet00

    psrnet00 New Member

    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    TO ADMIN,
    TO MEMBERS,
    TO THOSE WHO KNOWS FFMPEG,


    I look around many threads and posts in different sites, but bcz of less script and functions knowledge i am not able to get anything right, and also i know some sites (other than hosting site) provide this feature but they only allow max. length is 200 mb or less


    bcz i downloaded a movie that having different lang, i do not want to download 500 mb again, so i want to extract only audio and download it, i will delete those in 1 hrs after successfully conversion of vid to mp3, i want this for only personnel use and i am not going to allow any person expect me to use it, and even i will use only few times, bcz my main purpose is to learn php and hosting here


    so my three points are

    1. Admin and members who have privilege and authorized to access my site/domain can do it for me preload it for me plzzzzzzz

    2. if ffmapeg is not allowed at here x10hosting than plz admin and member tell me coz i donot want to be banned myself again

    3. can anyone explain me in simple and easy to understable that how do i can install ffmpeg on my server and extract audio from mp4/avi/mkv files
     
  10. nirajkum

    nirajkum New Member

    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    there are lots of open source project you can refer it and if you dont want to write the whole you can integrate tools in your project
     
  11. galaxyAbstractor

    galaxyAbstractor Community Advocate Community Support

    Messages:
    5,508
    Likes Received:
    35
    Trophy Points:
    48
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    Why not use a program on your computer? There are an extreme large amount free and paid software that can do this for you. If you only need subs for example, just download a .srt file from a subbing website and then download the CCCP-project and play it in media player classic and you will have the subs playing (subs have to be same name as video). On extracting sound, no idea about what software, but I'm sure there are a lot.

    Also, avi, mp4 and mkv is only the containers, not the codec itself. mkv is probably the easiest one to extract stuff from because how it's buit. Demux the mkv with a program like MKVExtractGUI (http://www.videohelp.com/tools/MKVExtractGUI) to get audio, video and subs as separate files. Then use some muxer tool like AVI-Mux GUI: http://www.alexander-noe.com/video/amg/
     
    Last edited: Jul 22, 2011
  12. psrnet00

    psrnet00 New Member

    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    galaxyAbstractor,

    I think you did not understand my question, :confused:

    in simple term i want to know will x10hosting banned me for using ffmpeg

    and if they allow me to use it than i need guide on it or preload or install it for me
    {sorry for bad english knowledge}

    :rolleyes:

    {think it - what you wrote in your answer}

    :rolleyes:

    you talk about subs - if i need just subs then there are already many sites that i know provide subs in many lang,

    using program on computer and codec and mkv extractor - i already have many programing software and also for that i have to download movie again and i have really slow connection and think why i will choice to convert downloaded movies when i already got new file/movie


     
  13. callumacrae

    callumacrae not alex mac Community Support

    Messages:
    5,257
    Likes Received:
    97
    Trophy Points:
    48
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    It can't be used on free hosting. You could probably use it on a VPS, though :)
     
  14. psrnet00

    psrnet00 New Member

    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    does VPS exits in free trail

    or

    free use with some restriction so i can first check that

    "am i ok with it or not"

    and than i can buy it
     
  15. iearn.tk54

    iearn.tk54 New Member

    Messages:
    85
    Likes Received:
    1
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    PHP video conversion script

    Video workshop - v1.0

    This is a video conversion PHP script created by me.

    It uses mencoder/ffmpeg for encoding videos from one format to another.

    There are several supported extensions :
    flv
    avi
    3gp
    mov
    mp4
    mp3

    There are various conversion options that let you change video bitrate,audio bitrate,video dimensions,audio frequency and channels. You can also watermark your videos using this script.

    Requires : FFmpeg / MenCoder installed on server.

    The script is best suited for video based sites hosted on a VPS / dedicated server.

    Installation : Follow readme.txt and then upload all files to your webhost.

    Download Page

    ---------- Post added at 06:30 AM ---------- Previous post was at 06:27 AM ----------

    Also 1 More.................

    [​IMG]

    Conversion options:

    - Upload & convert
    - Convert from url
    - Cron job

    including:
    Flash xml video uploader (AS3)

    Features:
    - supported input files: 3gp, avi, mpg, mpeg, mpe4, mov, m4a, mj2, flv, wmv, mp3, ogg, webm
    - converts to .flv, mp4, avi, wmv, mp3, ogg, webm
    - custom audio & video quality
    - custom video size
    - calculate video duration in next format 00:00:00 (hh:mm:ss)
    - upload progress bar
    - conversion progress bar
    - custom number of extracted images
    - custom size of extracted images
    - video preview with slideshow of extracted images on mouse over( like seen on dailymotion.com)
    - auto reloading pages when part of process is finished (no need to wait for click)
    - everything is stored in database
    - easier usage

    Flash uploader
    – xml driven
    – all tweeneng made by AS3
    – auto load next page after uploading is finished (with 10 sec. delay – can be set in AS)
    – max. input file size, suported input types, where to go after uploading is finished and displaying status messages can be set in xml file
    – CS3 & CS4 .fla
    – can be used for uploading other types of files, like documents or images. Explination in help file.

    Convert from url:

    -. support downloading and converting videos from internet (if video is allowed to be download)
    - sample of link: http://www.example.com/videos/test_video.mp4
    - custom maximum allowed video size
    - all features mention above

    Cron job – Upload now and convert later

    User can upload and set output quality for output video, when cron job is started conversion is made automaticly and after conversion is finished, it sends the user link for download new video (via e-mail in this example)



    Link Page
     
  16. saviorfromthenorth

    saviorfromthenorth New Member

    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    0
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    To install ffmpeg you will need to access your webhost via SSH, which is locked in a free account. So I guess using it is not possible. Not unless x10hosting would grant you special priviledges :).
     
  17. callumacrae

    callumacrae not alex mac Community Support

    Messages:
    5,257
    Likes Received:
    97
    Trophy Points:
    48
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    No - just buy a month and then if you like it, renew it for longer.


    Again incorrect - you would need SSH (or something similar) and permissions to install stuff on the server. ffmpeg will not be installed on free hosting.
     
  18. galaxyAbstractor

    galaxyAbstractor Community Advocate Community Support

    Messages:
    5,508
    Likes Received:
    35
    Trophy Points:
    48
    Re: using PHP - how to convert video (avi, mp4, mkv) or even extract audio/video/subt

    I still can't understand why you want to convert the video on a hosting server using PHP? IF you were able to, you would still have to upload the video to the server. Upload speeds are usually 10 - 20 times slower than download speeds, then you have to download the converted video. Then it would be faster to just download the video with correct language, or just get some software and do it on your computer. Or are you intending to start a service for this? If so, you would probably need a couple of dedicated servers for that.
     
  19. id0tx10m

    id0tx10m New Member

    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I found a way to enable ffmpeg. Change CPanel theme to the classic theme, and then scroll down to the "Select PHP Version" option. Click it and you will see a bunch of checkboxes, including FFmpeg! Check FFmpeg and click "Save"
     

Share This Page