i used this to extract video duration from ffprobe json output :
MOVIE_INFO=`ffprobe "path/to/movie.mp4" -show_streams -show_format -print_format json -v quiet`
MOVIE_SECONDS=`echo "$MOVIE_INFO"|grep -w \"duration\" |tail -1 | cut -d\" -f4 |cut -d \. -f 1`
it can be used to extract value from any json :
value=`echo "$jsondata"|grep -w \"key_name\" |tail -1 | cut -d\" -f4