Jump to content

Duration of video files


NTKBO
 Share

Recommended Posts

see #38,

reset $FFmpeg right after you declare it

$FFmpeg = FileGetShortName($FFmpeg)

can you also consolewrite(FileGetShortName($FFmpeg)) and copy it into your bat to see if you get the same behavior.

Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

i had tried that before and thought was a typo ... i am now getting this:

C:\Documents and Settings\admin\Desktop\Video App\www\recordings\XTreme4.flv
C:\Documents and Settings\admin\Desktop\Video App\www\bin\ffmpeg.exe
"C:\DOCUME~1\admin\Desktop\VIDEOA~1\www\bin\ffmpeg.exe" -i "C:\DOCUME~1\admin\Desktop\VIDEOA~1\www\RECORD~1\XTreme4.flv"
The filename, directory name, or volume label syntax is incorrect.
Link to comment
Share on other sites

awesome one step forward, now undo the shortname for the file.  Just declare that one normally, the quotes built into the $sCommands will handle the spaces in that path.

so as you had it renaming rVideo to sFile should work in the command with no further mod (or of course changing the name in the command to your preference, same same):

Global $recordings = @ScriptDir & "\www\recordings"
$rName = "World of Martial Arts Television_11_11_02_32_2014.flv"
$sFile = $recordings & "\" &  $rName
Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

awesome one step forward, now undo the shortname for the file.  Just declare that one normally, the quotes built into the $sCommands will handle the spaces in that path.

 

yep already did that and same error

C:\Documents and Settings\admin\Desktop\Video App\www\recordings\XTreme4.flv
C:\Documents and Settings\admin\Desktop\Video App\www\bin\ffmpeg.exe
"C:\DOCUME~1\admin\Desktop\VIDEOA~1\www\bin\ffmpeg.exe" -i "C:\Documents and Settings\admin\Desktop\Video App\www\recordings\XTreme4.flv"
The filename, directory name, or volume label syntax is incorrect.
Edited by dynamitemedia
Link to comment
Share on other sites

 

awesome one step forward, now undo the shortname for the file.  Just declare that one normally, the quotes built into the $sCommands will handle the spaces in that path.

so as you had it renaming rVideo to sFile should work in the command with no further mod (or of course changing the name in the command to your preference, same same):

 

the problem is ffmpeg is i a different directory , i need to be able to leave ffmpeg where it is and call it from there

Link to comment
Share on other sites

its not, you are past the ffmpeg error on on to an error with the argument.

here is proof that it works just fine:

post-59031-0-74563700-1425529215_thumb.p

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

maybe this is better:  Just declare the directory, and use that as your working dir in the run command

Global $FFmpegDir = "C:\Users\Ky\Desktop\DEV\Media\FFMPEG scripts"

$sFolder = "C:\Users\Ky\Videos\my test"
$sTarget = "20131119_124145_001_output_output.mp4"
$sFile = $sFolder & "\" & $sTarget

$sCommands = "FFmpeg -i " & '"' & $sFile & '"'

$iPID = Run("cmd /c " & $sCommands, $FFmpegDir , @SW_SHOW , $stderr_child + $stdout_child)

$sOutput = ""

 While 1
        $sOutput &= StderrRead($iPID)
        If @error Then ; Exit the loop if the process closes or StderrRead returns an error.
            ExitLoop
        EndIf
    WEnd

msgbox(0, '' , $sOutput)
msgbox(0, '' , stringregexp($sOutput , "Duration: (\d\d\:\d\d\:\d\d.\d\d)\," , 3)[0])

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

 

maybe this is better:  Just declare the directory, and use that as your working dir in the run command

Global $FFmpegDir = "C:\Users\Ky\Desktop\DEV\Media\FFMPEG scripts"

$sFolder = "C:\Users\Ky\Videos\my test"
$sTarget = "20131119_124145_001_output_output.mp4"
$sFile = $sFolder & "\" & $sTarget

$sCommands = "FFmpeg -i " & '"' & $sFile & '"'

$iPID = Run("cmd /c " & $sCommands, $FFmpegDir , @SW_SHOW , $stderr_child + $stdout_child)

$sOutput = ""

 While 1
        $sOutput &= StderrRead($iPID)
        If @error Then ; Exit the loop if the process closes or StderrRead returns an error.
            ExitLoop
        EndIf
    WEnd

msgbox(0, '' , $sOutput)
msgbox(0, '' , stringregexp($sOutput , "Duration: (\d\d\:\d\d\:\d\d.\d\d)\," , 3)[0])

and we have a winner!!   holy moses!  thanks so much!  hope this helps someone else,  any idea this was going this way?  i use a very similar ffmpeg command in other scripts with zero issues

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...