PHP Sort Order Proccess Codeiginiter

i use php codeigniter to manage video using FFMPEG, but i dont know how to delete original video after convertion succesful.

if(!($_FILES["upload_video"]["type"] == "video/mp4")) { $prename = $r.'.'.$ext; $video = $prename.'.mp4'; $directory_path = "/home/templates/videos/".$prename; $directory_path_full = "/home/templates/videos/".$prename; exec("ffmpeg -i ".$directory_path_full." ".$directory_path.".mp4"); // Delete original format video $this->load->helper("file"); unlink($directory_path_full); }else{ $video = $r.'.'.$ext; }

When i use "unlink" it work good to delete file, but the video is corrupt (maybe php directly delete it when converting progress) So, can you help me to create sort order php process for this case?


-------------Problems Reply------------

i got it in ffmpeg was created good command and i just use

exec("ffmpeg -i ".$directory_path_full." ".$directory_path.".mp4 && rm ".$directory_path_full." ");

or in shell

ffmpeg -i tmp.file new.file && rm tmp.file

Category:php Views:1 Time:2018-02-04

Related post

  • PHP/SQL: ORDER BY or sort($array)? 2009-03-17

    Which do you think is faster in a PHP script: $query = "SELECT... FROM ... ORDER BY first_val"; or while($row = odbc_fetch_array($result)) $arrayname[] = array( "first_key" => $row['first_val'], "second_key" => $row['second_val'], etc... ); sor

  • PHP sorting in numeric and alphabetical order 2011-03-29

    So I came across this block of code which pulls images from a folder specified and ouputs them with the img tag: <?php $url = "./images/"; $handle = opendir ($url); while (false !== ($file = readdir($handle))) { if($file != "." && $file !=

  • PHP sort by arbitrary order 2011-04-12

    I need a function in php to sort a list of words according to an arbitrary ordering. Any words in the list not in my predefined order should be sorted alphabetically at the end of the list. Below is my first attempt, it is neither elegant or efficien

  • Obtaining numeric/normalized representation of strings to aid in 'natural sort ordering' of titles in DB 2009-02-26

    I'd like to store an additional column in a table as a 'sort value', which is a numeric representation of the title column, such that the order of such values represents the string's natural alphabetical sort order. Ie, so that I can retrieve rows or

  • Re-sort orders to improve warehouse efficiency 2009-05-15

    I am trying to optimize how orders are filled at my work. Right now, an employee just grabs the latest 16 orders(sometimes 14 or 18) and fills them. I am trying to change it so that instead of simply going by the latest list of orders, that it orders

  • Jquery TableSorter 2.0 - Revert Sort order 2009-11-11

    All, I am using the JQuery TableSorter Plugin. The table sorts fine for the selected columns. Consider that when the page loads, there is no sorting taking place. Now, if the table is sorted by one column, it sorts. Now, upon clicking a "Revert Sort"

  • Control sort order of files in zip archive 2010-01-04

    Description I'm interested in learning if there is any way to control sort order of files inside zip files using standard routines in PHP and/or Java. I'm not primarily interested in using zip/unzip using shell_exec() or similar, but it can be of int

  • Sort the unsorted text file and rewrite to same text file in sorted order 2010-04-13

    I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this, Richmond,Virginia Seattle,Washington Los Angeles,Califor

  • PHP sorting an array by mysql date 2010-04-20

    I have an array that I would like to sort using a date field from a MySQL database. Here is a sample of the array which is named news in my class: [48] => Array ( [id] => 14 [type] => 3 [updated] => 2010-04-17 13:54:42 ) [49] => Array

  • PHP Sort a multidimensional array by element containing date 2010-05-26

    I have an array such as: Array ( [0] => Array ( [id] => 2 [type] => comment [text] => hey [datetime] => 2010-05-15 11:29:45 ) [1] => Array ( [id] => 3 [type] => status [text] => oi [datetime] => 2010-05-26 15:59:53 ) [2]

  • php sort properties of object 2010-05-31

    I want to sort the properties of an object so I can loop through them in a defined order. for example: I have an object 'book' with the following properties: 'id', 'title', 'author', 'date'. Now i want to loop through these properties like this: fore

  • Remember (persist) the filter, sort order and current page of jqGrid 2010-06-10

    My application users asked if it were possible for pages that contain a jqGrid to remember the filter, sort order and current page of the grid (because when they click a grid item to carry out a task and then go back to it they'd like it to be "as th

  • PHP - Sort array elements based on another array's elements :) 2010-07-07

    so I have two arrays. one of them looks like this (it's values or the number of elements can change): array('4dec' , 'def3', 'a3d6', 'd12f'); and the other: array(array('id' => 'd12f', 'name' => 'John'), array('id' => 'a5f1', 'name' => 'K

  • PHP - Sorting an Array 2010-08-25

    I am trying to sort an array that contains numbers that range in substantial values. The result I want to get is a descending order of those numbers from the array I am retrieving from a MySQL Server. So far I have created this to test out the "sort"

  • changing a lists sort order inline 2011-06-05

    I have a list Each row has a common input field "sort_order" that's stored in MySQL db. <input name="sort_order" type="text" value="<?php echo $cat['sort_order']; ?>" size="3" /> I want to be able to change the sort order inline, without

  • Magento - sort/order the suggestions in the Autocomplete search form 2011-06-10

    how can I change the sort/order in the suggestions of the Autocomplete search form. I use Magento version Thanks for help. --------------Solutions------------- To make it quick, copy /app/code/core/Mage/CatalogSearch/Model/Mysql4/Query/Collec

  • php sort($array) not working - returning 1 instead of sorted array 2011-06-22

    I have a non-associative array where the data that comes in is not sorted (I'm receiving the data from an outside system and cannot force it to come into the array in sorted order.) Is there any way to sort the values? I've tried this: $wedTrackTimes

  • Using PHP to order a MYSQL query result 2011-06-23

    I have a basic MySQL query: $getFeed = "SELECT posts.postID, posts.postTitle, ..... FROM posts LEFT JOIN users ON posts.userID = LEFT JOIN postScore ON posts.postID = postScore.postID GROUP BY posts.postID $feedResult = mysql_query($getFeed)

  • What is the most efficient way to store a sort-order on a group of records in a database? 2011-07-24

    Assume PHP/MYSQL but I don't necessarily need actual code, I'm just interested in the theory behind it. A good use-case would be Facebook's photo gallery page. You can drag and drop a photo on the page, which fires an Ajax event to save the new sort

  • PHP sort array using specific letter 2011-08-07

    I have an php array like below: Array ( [0] => Array ( [value] => 5 [label] => Akon ) [1] => Array ( [value] => 6 [label] => Angel ) [2] => Array ( [value] => 7 [label] => Britny ) [3] => Array ( [value] => 9 [label]

  • php sort() on array produces wrong result 2011-09-22

    I want to sort an array that looks like this (to numerical order instead of 1, 10, 11): Array ( [0] => 1.jpg [1] => 10.jpg [2] => 11.jpg [3] => 111.jpg [4] => 12.jpg [5] => 12a.jpg [6] => 13.jpg [7] => 14.jpg [8] => 15.jpg

  • Changing the new product widget sort order in Magento 2011-11-29

    I'm using Magento for my webshop and my homepage uses a new products widget. I want to change the sort order for the products within the widget. I searched for hours but I can't figure it out. --------------Solutions------------- The block for displa

  • php sort value ranges 2011-12-09

    I have a array of strings: 0 - 5 50-100 10-50 150-250 100-150 Now I want to automatically sort these to: 0-5 10-50 50-100 100-150 150-250 How would I go about this? --------------Solutions------------- You need to use the natsort() function. It sort

  • Possible to change sql sort order without reloading page? 2012-01-05

    Code for example: <?php $sql = "SELECT * FROM `table_name` ORDER BY `first_name` DESC"; $result = mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result) < 1) { echo "Database is empty"; } else { while ($details = mysql_fetch_array

Copyright (C), All Rights Reserved.

processed in 0.197 (s). 11 q(s)