Commit ed1754f3 authored by Andrey Filippov's avatar Andrey Filippov

added channel number offset as a single command line parameter

parent 4141c71a
......@@ -32,6 +32,11 @@ set_time_limit(60*60*24);
$chunksize=10000000; // 10MB
$startMarkerWithExif=chr(hexdec("ff")).chr(hexdec("d8")).chr(hexdec("ff")).chr(hexdec("e1"));
if (count($_SERVER ['argv']) > 1) {
$chn_shift = $_SERVER ['argv'][1] + 0;
} else {
$chn_shift = 0;
}
echo "<pre>\n";
......@@ -65,6 +70,7 @@ foreach ($files as $file) {
function split_mov($path,$mov_file,$dest,$ext,$startMarkerWithExif,$chunksize) {
global $chn_shift;
$path_with_name = "$path/$mov_file";
......@@ -109,7 +115,7 @@ function split_mov($path,$mov_file,$dest,$ext,$startMarkerWithExif,$chunksize) {
//converting GMT a local time GMT+7
$DateTimeOriginal_local=strtotime($exif_data['DateTimeOriginal']);/*-25200;*/
// $new_file_name = $exif_data['PageNumber'] . "_" . $DateTimeOriginal_local."_".$exif_data['SubSecTimeOriginal'].".".$ext;
$new_file_name = $DateTimeOriginal_local."_".$exif_data['SubSecTimeOriginal']. "_". $exif_data['PageNumber'] . ".".$ext;
$new_file_name = $DateTimeOriginal_local."_".$exif_data['SubSecTimeOriginal']. "_". ($exif_data['PageNumber']+$chn_shift) . ".".$ext;
rename($old_file_name,"$path/$dest/$new_file_name");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment