Code: Select all
#md fps_requested fps ms %diff
1 30 30.0219 33.309 +0.0730533%
2 15 15.0017 66.659 +0.0115013%
*3 1 0.996502 1003.51 -0.349772%
4 42 42.0253 23.7952 +0.0601962%
5 49 49.0057 20.4058 +0.0115813%
6 60 60.1135 16.6352 +0.189157%
7 90 90.1705 11.0901 +0.189458%
1 15 15.0042 66.6478 +0.028308%
2 5 5.00058 199.977 +0.0115013%
*3 1/6 0.166693 5999.05 +0.0158%
4 21 21.0024 47.6137 +0.0112313%
5 24 24.0111 41.6474 +0.0462614%
6 42 42.1116 23.7464 +0.265825%
7 60 60.1135 16.6352 +0.189157%
Code: Select all
#md fps_requested fps ms %diff
1 30 30.0183 33.313 +0.0610372%
2 15 14.9999 66.6669 -0.000349999%
*3 1 0.996383 1003.63 -0.361687%
4 42 42.0203 23.798 +0.0484234%
5 49 48.9997 20.4083 -0.000669996%
6 60 60.1063 16.6372 +0.177113%
7 90 90.1599 11.0914 +0.177715%
1 15 15.0025 66.6557 +0.0164527%
2 5 4.99998 200.001 -0.000499998%
*3 1/6 0.166673 5999.76 +0.0038%
4 21 20.9999 47.6193 -0.000529997%
5 24 24.0082 41.6524 +0.0342517%
6 42 42.1067 23.7492 +0.254004%
7 60 60.1063 16.6372 +0.177113%
I do want to double check mode 3. Setting exposure time with -ss is subtly different from selecting framerate, but I think your testing is valid. I just need to make sure that your two test points aren't the absolute extremes of the permissible values and are being slightly clipped - the 6s looks OK, but I'm surprised 1s gives more than 1s.ethanol100 wrote:Yes now everything seems OK.
(* For mode 3 I have requested -fps 0 and set the -ss to 1s and 6s.)
Code: Select all
3 1 0.996502 1003.51 1.549e-05 -0.349772%
Code: Select all
#fps fps ms %diff
#pi1
1/1 0.996502 1003.51 -0.349772%
1/2 0.500173 1999.31 +0.0345119%
1/3 0.332145 3010.73 -0.356392%
1/4 0.250086 3998.63 +0.0342617%
1/5 0.199292 5017.76 -0.353943%
1/6 0.166106 6020.26 -0.33653%
#pI2
1/1 0.996383 1003.63 -0.361687%
1/2 0.500113 1999.55 +0.0225051%
1/3 0.332106 3011.09 -0.368305%
1/4 0.250056 3999.1 +0.0225051%
1/5 0.199268 5018.36 -0.365857%
1/6 0.166086 6020.98 -0.348448%
Code: Select all
$ uname -a
Linux raspberrypi 3.18.9+ #1 PREEMPT Thu Aug 13 22:34:38 UTC 2015 armv6l GNU/Linux
Code: Select all
# /opt/vc/bin/vcgencmd version
Jan 30 2015 18:25:11
Copyright (c) 2012 Broadcom
version d6e004c61a7a749897c482c860d0b2c28196437e (clean) (release)
Code: Select all
$ raspivid
raspivid Camera App v1.3.12
Code: Select all
>>> require('picamera')[0].version
'1.9'
Code: Select all
$ avconv
avconv version 9.14-6:9.14-1rpi1rpi1, Copyright (c) 2000-2014 the Libav developers
Code: Select all
$ uname -a
Linux raspberrypi 4.1.19+ #1 Fri Mar 11 15:05:42 CET 2016 armv6l GNU/Linux
Code: Select all
$ /opt/vc/bin/vcgencmd version
Mar 9 2016 18:15:17
Copyright (c) 2012 Broadcom
version 3a754304b032a5298ee7889b179c667bbc75dec5 (clean) (release)
Code: Select all
$ raspivid
raspivid Camera App v1.3.12
Code: Select all
>>> require('picamera')[0].version
'1.10'
Code: Select all
$ avconv
avconv version 11.4-6:11.4-1~deb8u1+rpi1, Copyright (c) 2000-2014 the Libav developers
Code: Select all
#!/bin/bash
test_for_integer=$(echo "$1" | grep -P "^\d+$")
if [ "$test_for_integer" = "" ]; then
echo "Must provide an integer for length of recording (in seconds). Try again."
exit 1
fi
audio_length=$1
video_length=$((audio_length*1000))
timestamp=$(date +"%Y%m%d_%H%M%S")
audio_file="/tmp/audio_stream_${timestamp}"
video_file="/tmp/video_stream_${timestamp}"
merge_file="./merge_${timestamp}"
echo "Recording video and audio..."
raspivid -t ${video_length} -n -w 1280 -h 720 -fps 25 -o ${video_file}.h264 &
arecord -Dhw:sndrpiwsp -d ${audio_length} -c 2 -f s16_LE -r 8000 > ${audio_file}.wav
echo "Converting video to .mp4 format..."
MP4Box -add ${video_file}.h264 ${video_file}.mp4
echo "Merging video and audio files..."
avconv -y -fflags nobuffer -r 25 -i ${video_file}.mp4 -fflags nobuffer -analyzeduration 0 -i ${audio_file}.wav -map 0:0 -map 1:0 -filter:a aresample=async=1 -c:a copy -c:v copy ${merge_file}.mkv
mv "${video_file}.mkv" "${merge_file}.mkv"
Code: Select all
raspivid -t 0 -w 1280 -h 720 -ex fixedfps -fps 25 -b 6000000 -o - | ffmpeg -r 25.37 -i - -f alsa -ar 48000 -ac 1 -itsoffset 1 -i hw:1,0 -c:v copy -r 25 -vsync 1 -c:a aac -strict experimental output-mp4
it compensates the drift while recording. the values for '-r 25.37' and '-itsoffset 1' has to be figured out manually.deivid » Wed Oct 29, 2014 8:39 pm
Link here (tar.gz)
Code: Select all
raspivid -t 999999 -w 1920 -h 1080 -fps 25 -hf -o - | gst-launch-1.0 -v fdsrc ! video/x-h264,width=1920,height=1080,framerate=25/1 ! h264parse ! queue ! mux. alsasrc device="hw:0,0" ! audioconvert ! 'audio/x-raw,rate=44100,channels=2' ! queue ! mux. avimux name=mux ! filesink location=test.avi
Code: Select all
gst-launch-1.0 videotestsrc num-buffers=250 ! 'video/x-raw,format=(string)I420,width=320,height=240,framerate=(fraction)25/1' ! queue ! mux. alsasrc device="hw:0,0" ! audioconvert ! 'audio/x-raw,rate=44100,channels=2' ! queue ! mux. avimux name=mux ! filesink location=test.avi