0

enter image description herePlease help me out in this problem

Use of this program:

find duration of a video and audio

code :

loc="/e/[Content Creation]/audio_section_working/1.mp3"
echo $(ffprobe -v error -show_entries format=duration /
-of default=noprint_wrappers=1:nokey=1  $loc )

error :

Argument 'Creation]/audio_section_working/1.mp3' provided as input filename, but '/e/[Content' was already specified.

working earlier when no path was given , when i have done git bash on the same directory in which the file was located :

echo $(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "1.mp3" )

[ as u can see when i am giving path of file to find duration it is giving me error] [ giving direct path i.e. "1.mp3" is not giving me error ] [ giving file location path is giving error , why ? ]

img-1 location of image img-2 code which i ran

shank_fab_worker
  • 273
  • 3
  • 14

1 Answers1

1

Add two lines before, #!/bin/bash and IFS=$'\n'

Remove the first slash of the path, if noo such file or directory, check with initial slash in the path or look is the file exist, then, use the next code

#!/bin/bash
IFS=$'\n'  
loc='e/[Content Creation]/audio_section_working/01.mp3' 
echo  $(ffprobe   -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $loc )

King Regards

stevejobs
  • 391
  • 2
  • 4
  • e/[Content Creation]/audio_section_working/1.mp3: No such file or directory – shank_fab_worker Jun 16 '21 at 10:14
  • The error is other that the first question, are you shure that "e/[Content Creation]/audio_section_working/1.mp3" exist? you have checked with slash on start "/e/[Content Creation]/audio_section_working/1.mp3" – stevejobs Jun 16 '21 at 10:16
  • please look at the images in questions – shank_fab_worker Jun 16 '21 at 10:21
  • Open a windows cmd terminal and drag the file to the console, there you will get the real patch working, look how to open terminal on windows 10 https://www.wikihow.com/Open-Terminal-in-Windows – stevejobs Jun 16 '21 at 10:28
  • i hope u understand , we are working on bash – shank_fab_worker Jun 16 '21 at 10:33
  • Bro my hardisk was corrupted that is why it was not working.. no problem i will upload u and delete the question so that your contributions will increase ok bro (never say bad to anyone , wheteher that's a small talk or large one ) – shank_fab_worker Jun 16 '21 at 14:04