Script to reencode all files in a directory
by coltson from LinuxQuestions.org on (#4TDBD)
Hello.
I am currently trying to do a script to reencode all the files in a directory using ffmpeg
Here is it: Code:find . -type f -name '*.mp4' | while IFS= read -r f;
do
ffmpeg -y -i "${f}" -vf scale=720:-2 -c:v mpeg4 -vtag xvid -b:v 969k \
-r 25 -pass 1 -an -f avi <dev/null && \
ffmpeg -i "${f}" -c:a libmp3lame -b:a 48k \
-ac 1 -vf scale=720:-2 \
-c:v mpeg4 -vtag xvid -b:v 969k -pass 2 ".${f}.avi" ;
doneWhen I do this, I end receiving these many messages:
Quote:
Quote:
then:
Quote:
and finally
Quote:
Quote:
It ends reencoding only the first video in the dir.


I am currently trying to do a script to reencode all the files in a directory using ffmpeg
Here is it: Code:find . -type f -name '*.mp4' | while IFS= read -r f;
do
ffmpeg -y -i "${f}" -vf scale=720:-2 -c:v mpeg4 -vtag xvid -b:v 969k \
-r 25 -pass 1 -an -f avi <dev/null && \
ffmpeg -i "${f}" -c:a libmp3lame -b:a 48k \
-ac 1 -vf scale=720:-2 \
-c:v mpeg4 -vtag xvid -b:v 969k -pass 2 ".${f}.avi" ;
doneWhen I do this, I end receiving these many messages:
Quote:
| [h264 @ 0x41456c0] nal_unit_type: 1, nal_ref_idc: 0 Clipping frame in rate conversion by 0.020821 [h264 @ 0x4162a00] nal_unit_type: 1, nal_ref_idc: 2 [h264 @ 0x4138440] nal_unit_type: 1, nal_ref_idc: 0 [h264 @ 0x41456c0] nal_unit_type: 1, nal_ref_idc: 2 [h264 @ 0x4162a00] nal_unit_type: 1, nal_ref_idc: 0 [h264 @ 0x4138440] nal_unit_type: 1, nal_ref_idc: 0 [h264 @ 0x41456c0] nal_unit_type: 1, nal_ref_idc: 2 [h264 @ 0x4162a00] nal_unit_type: 1, nal_ref_idc: 0 [h264 @ 0x4138440] nal_unit_type: 1, nal_ref_idc: 2 [h264 @ 0x41456c0] nal_unit_type: 1, nal_ref_idc: 0 [h264 @ 0x4162a00] nal_unit_type: 1, nal_ref_idc: 0 |
| Enter command: <target>|all <time>|-1 <command>[ <argument>] Parse error, at least 3 arguments were expected, only 1 given in string 'T TO 2012 OLYMPICS-qK8cJH_b5fQ.mp4' |
Quote:
| Quote: Clipping frame in rate conversion by 0.344780 [h264 @ 0x5a036c0] nal_unit_type: 1, nal_ref_idc: 2 |
Quote:
Quote:
| [h264 @ 0x4f10a00] nal_unit_type: 1, nal_ref_idc: 0 Clipping frame in rate conversion by 0.065620 [mpeg4 @ 0x4f0c2a0] P qp:236<2108.0<3658 5337 want:215699 total:218738 comp:0.240138 st_q:2108.04 size:8624 var:4332426/460252 br:969 fps:25 stream #0: keyframe=0 duration=0.042 dts=222.722 pts=222.806 size=6954 |