Many times I use to make temporary files for certain task.
Files likeout1.ogg
out2.ogg
out11.ogg
out12.ogg
etcHere is the logic by which you can get logic to get new filename.
for example, in this case, new filename should be out13.ogg How to get name of new file.NewFileName=out$(($(find . -name "*out*.ogg" | while read FNAME; do fname=`echo $FNAME|sed 's/\.ogg$//g'|sed 's/\/out//g'|cut -c 2-` ; echo $fname ; done | sort -n | tail -n 1)+1)).ogg Here NewFileName will be out13.oggSimilarly , if we want to join then all, then the command will be
cat $(find . -name "*out*.ogg" | while read FNAME; do fname=`echo $FNAME|sed 's/\.ogg$//g'|sed 's/\/out//g'|cut -c 2-` ; echo $fname ; done | sort -n | while read NUM; do echo out$NUM.ogg; done) > final.ogg
I am trying to make a audio recorder using ffmpeg. ffmpeg cann't append files so we are doing like this.Thanks
Files likeout1.ogg
out2.ogg
out11.ogg
out12.ogg
etcHere is the logic by which you can get logic to get new filename.
for example, in this case, new filename should be out13.ogg How to get name of new file.NewFileName=out$(($(find . -name "*out*.ogg" | while read FNAME; do fname=`echo $FNAME|sed 's/\.ogg$//g'|sed 's/\/out//g'|cut -c 2-` ; echo $fname ; done | sort -n | tail -n 1)+1)).ogg Here NewFileName will be out13.oggSimilarly , if we want to join then all, then the command will be
cat $(find . -name "*out*.ogg" | while read FNAME; do fname=`echo $FNAME|sed 's/\.ogg$//g'|sed 's/\/out//g'|cut -c 2-` ; echo $fname ; done | sort -n | while read NUM; do echo out$NUM.ogg; done) > final.ogg
I am trying to make a audio recorder using ffmpeg. ffmpeg cann't append files so we are doing like this.Thanks
No comments:
Post a Comment