After using my sony cam I discovered that MTS files are not imported into iMovie for editing which was needed for a quick project today. After a bit of google-ing to understand if the version was the problem or what else I decided to go use a workaround as simple as a 1 line shell ffmpeg command:
ls -R /path | awk ' /:$/&&f{s=$0;f=0} /:$/&&!f{sub(/:$/,"");s=$0;f=1;next} NF&&f{ print s"/"$0 }'|grep *.MTS|while read i;
/do bitrate=`ffmpeg -i "$i" 2>&1 |grep bitrate|
/sed 's/.*bitrate: //' |sed 's/kb\/s/k/'`;ffmpeg -i "$i" -f avi -b $bitrate -ab 192k "$i".mov; done
Just discovered that a simple replacement of the container is faster and as much effective as the prev:
ls -R /path | awk ' /:$/&&f{s=$0;f=0} /:$/&&!f{sub(/:$/,"");s=$0;f=1;next} NF&&f{ print s"/"$0 }'|grep *.MTS|while read i;
do ffmpeg -i "$i" -vcodec copy -acodec copy "$i".mov; done
hope this will be helpful to someone (for sure it'll be for me so to paste the command each time needed :p)
Alex
This comment has been removed by the author.
ReplyDeletesomeone had problems with one line command due to the speed of ffmpeg.
ReplyDeleteYou can use the following to create a bash and then exec it
ls -1 *.MTS|while read i;do bitrate=`ffmpeg -i "$i" 2>&1 |grep bitrate|sed 's/.*bitrate: //' |sed 's/kb\/s/k/`;echo 'ffmpeg -y -i "'$i'" -f avi -b' $bitrate' -ab 192k "'$i'.DV"' >>convert.sh; done
This comment has been removed by a blog administrator.
ReplyDelete