Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatic number naming of files in php please help me with this I am using exec func

    $output is the variable I just need to know what to do with this.
    I need the $output to be a numbered jpeg such as 0000001.jpg 0000002.jpg
    and a numbered flv 0000001.flv 0000002.flv
    so I just need the numbering part
    how do I make it do this so that it is automaticly done lets say 0000001.jpg 0000002.jpg so the next one made will be 0000003.jpg and so on and so forth
    and the next flv
    made will be 0000003.flv and so on and so forth it does not need the extension I just need to make sure it does the sequence correctly so I don't get over written files etc.
    By the way the command runs ffmpeg

    PHP Code:
    <?php
    $input 
    $_GET['input'];
    $output = ?
    exec 'ffmpeg -i /home/forbushj/public_html/uploadvidd/'.$input.' -ar 22050 -ab 32 -f flv -s 320x240 /home/forbushj/public_html/2vidd/'.$output.'.flv';
    exec 'ffmpeg -i /home/forbushj/public_html/uploadvidd/'.$input.' -an -ss 00:00:45 -an -r 1 -vframes 1 -y -s 150x100 /home/forbushj/public_html/2vidd/'.$output.'.jpg';
    ?>

  • #2
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.


  •  

    Posting Permissions

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