-
-
Save priintpar/f7a56af8977206e9f45b486f767b02ac to your computer and use it in GitHub Desktop.
find . -type f -name '*media' >> unsortedlist.txt | |
sort unsortedlist.txt >> sortedlist.txt | |
while read line; do ffprobe $line; if [ $? = "1" ]; then echo $line; fi; done < sortedlist.txt >> corruptfiles.txt | |
awk 'NR==FNR{a[$0];next} !($0 in a)' corruptfiles.txt sortedlist.txt > temp; mv temp sortedlist.txt | |
while read line; do echo "file '$line'"; done < sortedlist.txt >> sortedlistwithoutcorruptfiles.txt | |
ffmpeg -f concat -safe 0 -i sortedlistwithoutcorruptfiles.txt -c copy outputvideo.mkv | |
rm unsortedlist.txt sortedlist.txt sortedlistwithoutcorruptfiles.txt corruptfiles.txt |
I'm curious if you were actually able to convert the .media file while retaining the audio, and if you could send it back to me. If this works, I would consider borrowing a Mac to perform the conversions instead of purchasing one.
Video link is not working for me. There is player but without video
The convertion code doesn't work when embedded audio is encoded in NHNT format typical for cloud cameras, but not usually recognised by default config ffprobe.
You need to buy mac
Irrelevant for this error. Further, the code purges present in the media folder structure "non-media" files with audio codec info, and fails to identify in the targeted day folder structure correct start & sequence & stop fragments belonging to the same motion event video. Too simplistic to be universally useful.
You need to buy mac